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] Should select option with selected attribute for select element with options having numeric values and labels #7111

Open
maniz-stha opened this issue Feb 15, 2023 · 2 comments

Comments

@maniz-stha
Copy link

Steps

Create a select element with options that have numeric values and labels.
<select class="dropdown"> <option value="3">1</option> <option value="4" selected="selected">2</option> <option value="5">3</option> <option value="6">4</option> </select>
Initialize dropdown with
$('.dropdown').dropdown();

Expected Result

The second option with value "4" should be selected.

Actual Result

The last optioin with label "4" is selected when rendered.

Version

2.4.1

Testcase

https://jsfiddle.net/wz3d0nre/1/

@GammaGames
Copy link
Contributor

GammaGames commented Feb 16, 2023

This appears to be fixed in Fomantic-UI

https://jsfiddle.net/y2bnm9qw/

@leodaouk
Copy link

Hello,

Issue is still happening on Semantic-UI, and is easier to view if you add "multiple" class to select. The result is the select has both 4 value and 4 labelled selected instead of only one. (https://github.com/Semantic-Org/Semantic-UI-CSS/blob/4049ee43af2613c62252f42b13addd737adf6420/components/dropdown.js#L1954)

Fomantic-UI changed bahavior by having only value search instead of value or text search (https://github.com/fomantic/Fomantic-UI/blob/0c3158da48b025adfc3f5424373d3254af014b1e/dist/components/dropdown.js#L2156)

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

No branches or pull requests

3 participants