Fix optimaizedinput
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
{#if optimaizedInput}
|
|
||||||
<textarea
|
<textarea
|
||||||
class={"border border-darkborderc n-scroll focus:border-borderc resize-none rounded-md shadow-sm text-textcolor bg-transparent focus:ring-borderc focus:ring-2 focus:outline-none transition-colors duration-200" + ((className) ? (' ' + className) : '')}
|
class={"border border-darkborderc n-scroll focus:border-borderc resize-none rounded-md shadow-sm text-textcolor bg-transparent focus:ring-borderc focus:ring-2 focus:outline-none transition-colors duration-200" + ((className) ? (' ' + className) : '')}
|
||||||
class:text-sm={size === 'sm'}
|
class:text-sm={size === 'sm'}
|
||||||
@@ -24,45 +24,26 @@
|
|||||||
id={id}
|
id={id}
|
||||||
bind:value={value}
|
bind:value={value}
|
||||||
on:input={(e) => {
|
on:input={(e) => {
|
||||||
|
if(optimaizedInput){
|
||||||
if(inpa++ > 10){
|
if(inpa++ > 10){
|
||||||
value = e.currentTarget.value
|
value = e.currentTarget.value
|
||||||
inpa = 0
|
inpa = 0
|
||||||
onInput()
|
onInput()
|
||||||
}
|
}
|
||||||
}}
|
}
|
||||||
on:change={(e) => {
|
else{
|
||||||
value = e.currentTarget.value
|
value = e.currentTarget.value
|
||||||
onInput()
|
onInput()
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
on:change={(e) => {
|
||||||
|
if(optimaizedInput){
|
||||||
|
value = e.currentTarget.value
|
||||||
|
onInput()
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{:else}
|
|
||||||
<textarea
|
|
||||||
class={"border border-darkborderc n-scroll focus:border-borderc resize-none rounded-md shadow-sm text-textcolor bg-transparent focus:ring-borderc focus:ring-2 focus:outline-none transition-colors duration-200" + ((className) ? (' ' + className) : '')}
|
|
||||||
class:text-sm={size === 'sm'}
|
|
||||||
class:text-md={size === 'md'}
|
|
||||||
class:text-lg={size === 'lg'}
|
|
||||||
class:text-xl={size === 'xl'}
|
|
||||||
class:text-xs={size === 'xs'}
|
|
||||||
class:px-4={padding}
|
|
||||||
class:py-2={padding}
|
|
||||||
class:mb-4={margin === 'bottom'}
|
|
||||||
class:mb-2={margin === 'both'}
|
|
||||||
class:mt-4={margin === 'top'}
|
|
||||||
class:mt-2={margin === 'both'}
|
|
||||||
class:w-full={fullwidth}
|
|
||||||
class:h-20={height === '20'}
|
|
||||||
class:h-24={height === '24'}
|
|
||||||
class:h-32={height === '32'}
|
|
||||||
class:h-full={height === 'full'}
|
|
||||||
class:min-h-20={height === '20'}
|
|
||||||
class:min-h-32={height === '32'}
|
|
||||||
{autocomplete}
|
|
||||||
{placeholder}
|
|
||||||
id={id}
|
|
||||||
bind:value
|
|
||||||
on:input={onInput}
|
|
||||||
/>
|
|
||||||
{/if}
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export let size: 'xs'|'sm'|'md'|'lg'|'xl' = 'xs'
|
export let size: 'xs'|'sm'|'md'|'lg'|'xl' = 'xs'
|
||||||
export let autocomplete: 'on'|'off' = 'off'
|
export let autocomplete: 'on'|'off' = 'off'
|
||||||
|
|||||||
Reference in New Issue
Block a user