"Filterable inside custom select" widget's placeholder is being taken into a count #7396

Closed
0xMarK opened this Issue May 13, 2014 · 4 comments

Comments

Projects
None yet
4 participants
@0xMarK

0xMarK commented May 13, 2014

I had used the code from here: http://demos.jquerymobile.com/1.4.2/selectmenu-custom-filter/
But placeholder was still in the filtering results. So I fixed the problem with this line of code:

$.mobile.filterable.prototype.options.children = "> li:not(:jqmData(placeholder='true')), > option, > optgroup option, > tbody tr, > .ui-controlgroup-controls > .ui-btn, > .ui-controlgroup-controls > .ui-checkbox, > .ui-controlgroup-controls > .ui-radio";

The main thing here is: > li:not(:jqmData(placeholder='true'))

I propose to use my value of children for "mobile.filterable" widget. (line no.13631 jquery.mobile-1.4.2.js)

See the results: http://jsfiddle.net/WqpnA/

P.S. please make a standard component with this behavior. So developers won't have to write a lot of code from widget "Filterable inside custom select"...

@0xMarK 0xMarK closed this May 13, 2014

@0xMarK 0xMarK reopened this May 13, 2014

@jaspermdegroot

This comment has been minimized.

Show comment
Hide comment
@jaspermdegroot

jaspermdegroot May 13, 2014

Member

@0xMarK

Thanks for reporting the problem you ran into. I suggest we change the demo a little bit so it has a placeholder as well and we show how to set option children when you call the filterable widget.

I am not in favor of integrating the behavior in the widget, because it doesn't fit in our goal to simplify our widgets.

Member

jaspermdegroot commented May 13, 2014

@0xMarK

Thanks for reporting the problem you ran into. I suggest we change the demo a little bit so it has a placeholder as well and we show how to set option children when you call the filterable widget.

I am not in favor of integrating the behavior in the widget, because it doesn't fit in our goal to simplify our widgets.

@slavap

This comment has been minimized.

Show comment
Hide comment
@slavap

slavap May 14, 2014

It's not fixed completely, there is another bug. I've opened issue #7405
Also this functionality should be added into widget or additional widget created (it's needed quite often, and "goal to simplify our widgets" has not to be applied here IMO).

slavap commented May 14, 2014

It's not fixed completely, there is another bug. I've opened issue #7405
Also this functionality should be added into widget or additional widget created (it's needed quite often, and "goal to simplify our widgets" has not to be applied here IMO).

@0xMarK

This comment has been minimized.

Show comment
Hide comment
@0xMarK

0xMarK May 15, 2014

@slavap I totally agree. In my mobile project I use it 4 times! It annoys much to write that bunch of code everytime I need it :(

jQuery Mobile could use some kind of modifier like that:

<select data-filterable="true">

0xMarK commented May 15, 2014

@slavap I totally agree. In my mobile project I use it 4 times! It annoys much to write that bunch of code everytime I need it :(

jQuery Mobile could use some kind of modifier like that:

<select data-filterable="true">
@gabrielschulhof

This comment has been minimized.

Show comment
Hide comment
@gabrielschulhof

gabrielschulhof May 20, 2014

Contributor

@slavap and @0xMarK this is already on our radar.

Contributor

gabrielschulhof commented May 20, 2014

@slavap and @0xMarK this is already on our radar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment