I have a table where I allow the user to click an icon in the column to filter that column. I have a column that allow filtering with a search bar and another with a toggle. I want to create another filter with date range picker but I have an issue:
I expand the dropdown menu
I click on the date range picker input to show the calendar
I click on the left arrow to go to the previous month (the dropdown menu disappear)
I select a date range, as soon as I click to select the end date the picker move to top right corner of the page (I think it’s because the dropdown menu is not there anymore and the picker doesn’t “know” where he should be)
Is there an option or something to do fix that? Prevent click event to propagate and close the dropdown menu maybe?
Something like that should work. There are modifiers in Wappler click event etc for this.
For date picker specifically, I think you will have to use js.
Well not exactly, it close after following specific scenario: clicking on left or right arrow to navigate month by month. I think it’s because the first time I click an arrow it close the menu, then if I click on anything the picker will try to recaculate where it should be but since the menu is no there anymore it bind itself to the body.
Ok. Since it does not close on click of the input where the picker draws itself, you can use JS there.
On onclick event of input, set a timer for few ms. On callback, try to find and select the datetime picker like you have done in console.
Then, you can set prevent/stop on it.
I have not played around with bootstrap down a lot. Maybe there would be a better solution.
That said, you could also think of a better UI since drop down’s purpose is to show selectable options, or switch button from what I understand.
For a more complicate input, like the date picker, a different UI could be better.