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

fix(dropdown): insert clearable at correct dom position #2794

Merged
merged 2 commits into from
May 22, 2023

Conversation

lubber-de
Copy link
Member

Description

This PR makes sure a clearable icon is always positioned at the correct DOM node in case incomplete markup exists.

Testcase

The dropdown is instantiated twice.

  • The first time, clearable should not be set, but the search input is missing in the markup, so FUI created the search input
  • The second time, the dropdown should be clearable, but this time the search input is already existing. This results into the remove icon not being a direct sibling of the dropdown icon which in turn makes clearing selections not working anymore

Broken

Selected items are not clearable
https://jsfiddle.net/lubber/oktecuv2/8/

Fixed

Selected items are clearable
https://jsfiddle.net/lubber/oktecuv2/10/

Fixes

#2791

@lubber-de lubber-de added type/bug Any issue which is a bug or PR which fixes a bug state/awaiting-reviews Pull requests which are waiting for reviews javascript Pull requests that update Javascript code labels May 21, 2023
@lubber-de lubber-de added this to the 2.9.3 milestone May 21, 2023
@mvorisek
Copy link
Contributor

Bravo @lubber-de for finding the root of the problem, I tested this fix and it works.

Copy link
Member

@ko2in ko2in left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@lubber-de lubber-de merged commit f574a6b into fomantic:develop May 22, 2023
@lubber-de lubber-de deleted the clearableInsert branch May 22, 2023 05:08
@lubber-de lubber-de removed the state/awaiting-reviews Pull requests which are waiting for reviews label May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code type/bug Any issue which is a bug or PR which fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants