bestguy / sveltestrap

Bootstrap 4 & 5 components for Svelte
https://sveltestrap.js.org
MIT License
1.3k stars 180 forks source link

Input date with max attribute keyboard issue #585

Open StagnantIce opened 6 months ago

StagnantIce commented 6 months ago

{...$$restProps} clear year in date field, if you try write it in field by keyboard.

<script>
    import Input from './Input.svelte';

    const day18YearsAgo = new Date();
    let data = '';
</script>

            <Input
                type="date"
                bind:value={data}
                max={day18YearsAgo.toISOString().slice(0, 10)}
            />

Actual result: You can't write year by keyabord

Expected result You can write year by keyboard

StagnantIce commented 6 months ago

If make max property - we can avoid this behavior.

StagnantIce commented 6 months ago

Review please https://github.com/bestguy/sveltestrap/pull/586/files