Hi everyone!
I'm developing my first app for Android using Framework7 and I'm trying to close a smart select with javascript.
On the website i saw a method for open smart select with js:
myApp.smartSelectOpen(smartSelect)
Is there something similar for close?
I also tried to trigger a click event on "close-picker" ($(".close-picker:eq(0)").trigger("click")) but this is not working while alert($(".close-picker:eq(0)").html()) is working.
Thanks and sorry for my bad english :(
indicate this property
data-back-on-select="true"
// data-back-on-select="true" to close page automatically
<li><a href="#" class="item-link smart-select" data-back-on-select="true">
.
Thanks. This works but what I really need is that if the back button on android is clicked and the smart select is visible then close the smart select. I can override the backbutton event and check if smart-select is visible but i can't close it
you can show screenshoot
Sorry for the late response :(
So, I'm in this situation.
I want that if the user press the android back button, then the smart select will close.

Try: mainView.router.back()
that will take the user back a page. not what was asked for
Well, i had the same issue: close openned smartSelect using android back button, and i solved like that. I dont used picker but searchbar and worked very well.
yeah because you probably had smartSelect as a page so going back would close it
What about something like this:
if ($('.smart-select-picker.modal-in').length > 0) {
myApp.closeModal('.smart-select-picker.modal-in');
}
@sfontana7 I tried everything mentioned above before finding this thread and your solution was the only thing that worked for me.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
What about something like this:
if ($('.smart-select-picker.modal-in').length > 0) {
myApp.closeModal('.smart-select-picker.modal-in');
}