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

BUGFIX: Stop click event propagation on selected element in select box header #3341

Merged

Conversation

grebaldi
Copy link
Contributor

fixes: #3057

The Problem

Hard to pin down, but I'll try: The issue described in #3057 relates to the AssetEditor which uses the <SelectBox/> component for input. The <SelectBox/> component uses the <DropDown/> component for rendering. The <DropDown/> component understands a click on its header as a request to toggle its expanded state. When expanded === true, the <SelectBox/> changes its header into a search input, so the user can search through the available select options.

Now, the AssetEditor kind of misuses the <SelectBox/> for its purpose. It narrows the available select options to the currently selected asset, so the <SelectBox/> displays the latter properly. This however means that the behavior described above leads to a search input, but only one available select option: the currently selected one. (Side note: On input, the search is still being performed, the <SelectBox/> simply does not show the resulting options)

The Solution

I've tried to correct the behavior of the AssetEditor, so that it shows the search results, but with no luck.

So, I ended up implementing the suggestion from #3057. Through stopPropagation, a click on the currently selected option won't toggle the underlying <DropDown/> component any longer.

@grebaldi grebaldi added Bug Label to mark the change as bugfix UI & UX Accessibility 7.3 labels Jan 25, 2023
@grebaldi grebaldi force-pushed the bugfix/3057/stop-propagation-on-selectbox-click branch from 3161b0f to 3fe2bad Compare January 25, 2023 11:32
@grebaldi grebaldi linked an issue Jan 26, 2023 that may be closed by this pull request
@grebaldi grebaldi force-pushed the bugfix/3057/stop-propagation-on-selectbox-click branch from 3fe2bad to 3e87aec Compare January 27, 2023 12:06
…x header

...if the header has an `onClick`-handler.
@grebaldi grebaldi force-pushed the bugfix/3057/stop-propagation-on-selectbox-click branch from 3e87aec to 7788882 Compare January 31, 2023 13:39
Copy link
Member

@Sebobo Sebobo left a comment

Choose a reason for hiding this comment

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

Great, thx!

@Sebobo Sebobo merged commit b4e659d into neos:7.3 Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
7.3 Accessibility Bug Label to mark the change as bugfix UI & UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AssetEditor: Cannot replace the Asset on clicking the Asset's title
2 participants