fix(Datepicker): unexpected close on calendar interaction#630
Conversation
…raction" This reverts commit 849ae54.
… hide event handlers
|
I've been working on this lately, it turned out a bit more a complex use-case since the calendar redraws on interaction, as a result the clicked element is already overwritten by the calendar draw method and the display plugin did not recognizes the clicked element as a child element of the calendar component This all had to do with JavaScript event propagation: bubbling vs capture Excerpt from this W3 schools article: Since the default JavaScript event propagation is bubbling, the calendar event handlers where executed first because being the most inner DOM elements, changing the propagation for the display plugin implementations to capturing solved this issue |
wuda-io
left a comment
There was a problem hiding this comment.
So you added the files here 😂 We should find a better solution for displaying stuff on top (modal) or next to each other. We should use a single component like PopperJs or a custom made Class which uses popover methods. Also I like the storybooks approach for development. I will take a look later in depth.
I did and updated accordingly, can you review the fix? |
Proposed changes
This fixes a bug where the display plugin closes on calendar interaction when the calendar has to be redrawn, the redraw function causes the clicked element not to be found, adding a timeout on the draw method fixes the issue
Types of changes
Checklist: