mskocik / svelty-picker

Simple date & time picker in svelte
https://mskocik.github.io/svelty-picker/
202 stars 46 forks source link

endDate doesn't seem to be reactive #128

Closed asticode closed 1 year ago

asticode commented 1 year ago

Hi 👋

And thanks for this awesome svelte component!

I'm using the endDate attribute and I want it to be reactive (I have 2 datetime pickers, and once I select a value in the first one, I want the endDate in the second one to be updated), however it doesn't seem to be reactive.

Is it something desired?

Cheers Quentin

mskocik commented 1 year ago

It is reactive, maybe you have it wrong in your code. Here is working example:

<script>
    import SveltyPicker from 'svelty-picker';

    let valOne;
</script>

Restricted selection list:<br>
<SveltyPicker bind:value={valOne} />
<br>
<SveltyPicker endDate={valOne} />

image

asticode commented 1 year ago

I was not using the latest version since I had the same issue as this one but when using the latest version it works properly.

However, to fix the error Failed to resolve entry for package "svelty-picker". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." entry in "svelty-picker" package I needed to add "default": "./dist/index.js", to the exports > . key in the package.json. Would you be open to make that change in the package.json? I could make a PR if you prefer.

mskocik commented 1 year ago

Thanks for pointing out the issue with exports definition - I added it and released new version (4.1.3).

rakshay905 commented 1 year ago

Thanks for the update, will try it

asticode commented 1 year ago

Everything works like a charm for me ❤️