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] option text is filled with value if empty #1191

Closed
lhns opened this issue Nov 21, 2019 · 1 comment
Closed

[Dropdown] option text is filled with value if empty #1191

lhns opened this issue Nov 21, 2019 · 1 comment
Assignees
Labels
lang/javascript Anything involving JavaScript type/bug Any issue which is a bug or PR which fixes a bug
Milestone

Comments

@lhns
Copy link
Contributor

lhns commented Nov 21, 2019

Bug Report

When I create a dropdown from a select, all options that had an empty text get the value as their text.
This was introduced in #1112:

- html +=   escape(option[fields.name],preserveHTML);
+ html +=   escape(option[fields.name] || option[fields.value],preserveHTML);

Is this behavour intentional? It doesn't happen on normal selects.

Steps to reproduce

  1. Create a select:
<select class="ui search dropdown filter-dropdown">
  <option value="-1"></option>
  <option value="0">Item A</option>
  <option value="1">Item B</option>
  <option value="2">Item C</option>
</select>
  1. Initialize dropdown:
$(".dropdown").dropdown();

Expected result

The first option is empty.

Screenshot

grafik

Actual result

The first option has "-1" as its text.

Screenshot

grafik

Testcase

https://jsfiddle.net/mons57e2/

Version

Since #1112

@lhns lhns added the state/awaiting-investigation Anything which needs more investigation label Nov 21, 2019
@lubber-de lubber-de self-assigned this Dec 6, 2019
@lubber-de lubber-de added type/bug Any issue which is a bug or PR which fixes a bug lang/javascript Anything involving JavaScript labels Dec 6, 2019
@lubber-de lubber-de added this to the 2.8.3 milestone Dec 6, 2019
@lubber-de lubber-de removed the state/awaiting-investigation Anything which needs more investigation label Dec 6, 2019
@lubber-de
Copy link
Member

Fixed by #1209

@lubber-de lubber-de added the state/has-pr An issue which has a related PR open label Dec 6, 2019
@lubber-de lubber-de added tag/next-release/nightly Any issue which has a corresponding PR which has been merged and is available in the nightly build and removed state/has-pr An issue which has a related PR open labels Dec 22, 2019
@y0hami y0hami closed this as completed in 9892bcb Dec 23, 2019
@y0hami y0hami removed the tag/next-release/nightly Any issue which has a corresponding PR which has been merged and is available in the nightly build label Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/javascript Anything involving JavaScript type/bug Any issue which is a bug or PR which fixes a bug
Projects
None yet
Development

No branches or pull requests

3 participants