Fix enter causing collapse in chromium
This commit is contained in:
@@ -34,7 +34,7 @@
|
|||||||
export let marginBottom = false
|
export let marginBottom = false
|
||||||
export let fullwidth = false
|
export let fullwidth = false
|
||||||
export let fullh = false
|
export let fullh = false
|
||||||
export let onChange:ChangeEventHandler<HTMLInputElement>
|
export let onChange:ChangeEventHandler<HTMLInputElement> = () => {}
|
||||||
export let className = ''
|
export let className = ''
|
||||||
export let disabled = false
|
export let disabled = false
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
>
|
>
|
||||||
{#if !highlight}
|
{#if !highlight}
|
||||||
<textarea
|
<textarea
|
||||||
class="w-full h-full bg-transparent focus-within:outline-none resize-none absolute top-0 left-0 z-10 overflow-y-auto"
|
class="w-full h-full bg-transparent focus-within:outline-none resize-none absolute top-0 left-0 z-50 overflow-y-auto"
|
||||||
class:px-4={padding}
|
class:px-4={padding}
|
||||||
class:py-2={padding}
|
class:py-2={padding}
|
||||||
{autocomplete}
|
{autocomplete}
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
/>
|
/>
|
||||||
{:else if isFirefox}
|
{:else if isFirefox}
|
||||||
<div
|
<div
|
||||||
class="w-full h-full bg-transparent focus-within:outline-none resize-none absolute top-0 left-0 z-10 overflow-y-auto px-4 py-2 break-words whitespace-pre-wrap"
|
class="w-full h-full bg-transparent focus-within:outline-none resize-none absolute top-0 left-0 z-50 overflow-y-auto px-4 py-2 break-words whitespace-pre-wrap"
|
||||||
contenteditable="true"
|
contenteditable="true"
|
||||||
bind:textContent={value}
|
bind:textContent={value}
|
||||||
on:keydown={(e) => {
|
on:keydown={(e) => {
|
||||||
@@ -91,9 +91,9 @@
|
|||||||
>{value ?? ''}</div>
|
>{value ?? ''}</div>
|
||||||
{:else}
|
{:else}
|
||||||
<div
|
<div
|
||||||
class="w-full h-full bg-transparent focus-within:outline-none resize-none absolute top-0 left-0 z-10 overflow-y-auto px-4 py-2 break-words whitespace-pre-wrap"
|
class="w-full h-full bg-transparent focus-within:outline-none resize-none absolute top-0 left-0 z-50 overflow-y-auto px-4 py-2 break-words whitespace-pre-wrap"
|
||||||
contenteditable="plaintext-only"
|
contenteditable="plaintext-only"
|
||||||
bind:textContent={value}
|
bind:innerText={value}
|
||||||
on:keydown={(e) => {
|
on:keydown={(e) => {
|
||||||
handleKeyDown(e)
|
handleKeyDown(e)
|
||||||
onInput()
|
onInput()
|
||||||
@@ -185,6 +185,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const insertContent = (insertContent:string, type:'autoComplete'|'paste' = 'autoComplete') => {
|
const insertContent = (insertContent:string, type:'autoComplete'|'paste' = 'autoComplete') => {
|
||||||
|
console.log(insertContent)
|
||||||
const sel = window.getSelection()
|
const sel = window.getSelection()
|
||||||
if(sel){
|
if(sel){
|
||||||
const range = sel.getRangeAt(0)
|
const range = sel.getRangeAt(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user