Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dropdown] - Add ability to clear selected value with (x) #1820

Closed
zelenin opened this issue Feb 18, 2015 · 4 comments
Closed

[Dropdown] - Add ability to clear selected value with (x) #1820

zelenin opened this issue Feb 18, 2015 · 4 comments

Comments

@zelenin
Copy link

zelenin commented Feb 18, 2015

Empty options are removed. I cannot reset filter selecting empty option.
http://jsfiddle.net/zelenin/0kxLxxe5/1/
http://yii2-semantic-ui.zelenin.pw/yii2-widgets/grid-view.html real example, see 'Name' filter.

@jlukic
Copy link
Member

jlukic commented Feb 18, 2015

Empty string values '' were designed around being placeholder values not actual selectable values.

I would recommend using a different value if possible, for example no value.
http://jsfiddle.net/zvt8n01a/

It would also make sense to have clearable as an option. But this might take a while.

@jlukic jlukic changed the title Dropdown bug for empty options [Dropdown] - Add ability to clear selected value with (x) Feb 18, 2015
@zelenin
Copy link
Author

zelenin commented Feb 18, 2015

Oh, I understand it but I think that it's very-very-very big hack using empty value for placeholder generation. You must understand it.
There is no case for clear selected value. There is case about not-full support of native selects.
I think its behavior should be changed.

@jlukic jlukic closed this as completed Mar 26, 2015
@jlukic
Copy link
Member

jlukic commented Mar 26, 2015

This is the same setup select2 uses. I think its alright

@zelenin
Copy link
Author

zelenin commented Mar 26, 2015

no, select2 not use it.

example:
http://jsfiddle.net/0kxLxxe5/3/

It changes standard behaviour of select. It's cannot alright.

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

No branches or pull requests

2 participants