Skip to content

🐛 DatePick shows for a few milliseconds on mount when isOpen is false #47

Open
@gregg-cbs

Description

@gregg-cbs

Describe the bug
The DatePicker seems to be mounting and then umounting on svelte mount. This happens in a matter of milliseconds so its not detectable normally but i picked it up in my Modal which transitions in.

It seems something in the DatePicker code is showing the DatePicker when isOpen is false. It seems it is showing the date picker and then hiding it as if the default behavior is to show and then to check the isOpen prop and hide.

For me this is a bad experience as when my modal opens and transitions in there is a large white space where the date picker is and then it disappears. My date picker is relatively positioned which is why it takes up space, it is not floating.

If I wrap the DatePicker in an if statement, i do not get this issue:

{#if is_open}
  <DatePicker 
    isOpen={true} 
  />
{/if}

Expected behavior
DatePicker to not mount at all when isOpen is false

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Firefox
  • Version: 137.0b8

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions