craftpip / bootstrap-fullscreen-select

[unmaintained] Fullscreen select for mobile devices.
http://craftpip.github.io/bootstrap-fullscreen-select
MIT License
88 stars 25 forks source link

Select like native - without save and cancel button #16

Open ashvin777 opened 7 years ago

ashvin777 commented 7 years ago

Is it possible to use this select popup without having save and cancel button on the bottom of the popup. It should select the row selected and close the popup then itself instead of additional Save click.

Please confirm if it is already available or if there is any way to do that.

Frank004 commented 5 years ago

I'm looking for the same option any update on this.

johnsonbeng commented 5 years ago

You can change the _bindEvents function. In the "mobileSelect-control" click handler function, you can insert that.syncR(); and that.hide(); after $this.siblings().removeClass('selected').end().addClass('selected'); (after row 254). After that you can remove the buttons from _buildHTML function (after row 146) something like this:


this.$c.find('.mobileSelect-clearbtn').remove();
this.$c.find('.mobileSelect-cancelbtn').remove();
this.$c.find('.mobileSelect-buttons').remove();
this.$c.find('.list-container').css('margin-bottom',0);
SyafiqTM commented 4 years ago

After following as exactly what johnsonbeng told. It really works like a native select. Thank you very much!

Frank004 commented 4 years ago

@SyafiqTM where did you find that file to edit and insert that lines of code or is a custom script in the assets?

SyafiqTM commented 4 years ago

it was inside bootstrap-fullscreen-select.js created by author himself.