ghiscoding / slickgrid-universal

Slickgrid-Universal is a monorepo which includes all Editors, Filters, Extensions, Services related to SlickGrid usage and is also Framework Agnostic
https://ghiscoding.github.io/slickgrid-universal/
Other
89 stars 29 forks source link

Date Filter does not always change picker value and also has DOM leakages #1582

Closed ghiscoding closed 4 months ago

ghiscoding commented 4 months ago

Describe the bug

I was troubleshooting what I thought was a styling issue with the Compound Date Filter which happened after changing the filters dynamically (via Example 10 or 11), the input seem to be wider than the available container. It turns out that it's a much bigger bug in the external lib which is even creating leakage.

Reproduction

After investigating, I found out that the new vanilla-calendar is overriding the input as the new calendar picker and when we then click the same input, it also creates a 2nd date picker. I also found that after clearing the filter and updating filter dynamically, it did not always set the new date into the picker and that is because the set filter value was missing the cv.update({ year: true, month: true }}, but then after doing this .update(), that is when the leakage happens (which overrides the input and creates 2 picker elements after clicking the input)

what the animated gif is demoing

  1. after clearing/updating dynamically the filter, the input becomes wider than the available space
  2. the input gets overriden and becomes the new picker
  3. clearing, then setting new filter, doesn't correctly set the dates
  4. doing a query.selectorAll in the console, shows 2 elements with the CSS class .vanilla-calendar but there should be only 1 element

brave_7ZNVAcHMMA

Which Framework are you using?

Vanilla / Plain JS

Environment Info

| Executable          | Version |
| ------------------- | ------- |
| (framework used)    | all |
| Slickgrid-Universal | latest |
| TypeScript          | latest |
| Browser(s)          | all |
| System OS           | Windows |

Validations

ghiscoding commented 4 months ago

@zewa666 FYI, this is a bug in the external vanilla-calendar picker, which at this point I'm still using my fork of it, so I'll look at fixing it in my fork. One I have in mind to fix this issue is to explicitly initialize the calendar picker before calling the vs.update(). I have also opened a bug on the original repo, we'll see if the author replies and provides a better fix

zewa666 commented 4 months ago

I'm going to be on vacation a couple of days but will take a look at the PR whichever one it is than.

ghiscoding commented 4 months ago

it's all good, I just wanted to inform you that's all, I'll take care of it all.

ghiscoding commented 4 months ago

and there you go, here's the PR in my fork that fixes the issue