Fix ft-prompt
closing when clicking elements with role="button"
#5096
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix
ft-prompt
closing when clicking elements withrole="button"
Pull Request Type
Description
There does not seem to be any cases of
role="button"
currently within anft-prompt
except for within theft-input
in the add video to playlist prompt. In that case, the search clear button hasrole="button"
, and hiding the whole prompt when it is clicked doesn't seem like intentional behaviour. I find it jarring as it overrides what the button is supposed to do (clear the search bar) with seemingly unintended functionality (close the whole prompt). This PR addresses this by removing the check for elements withrole="button"
within thehandleHide
method offt-prompt
.Screenshots
Testing
X
button within theft-input
componentft-prompt
does not closeDesktop
Additional context
On the chance that there is some usage of this check in the app currently which I overlooked, I would reason that it should be adjusted by modifying the click event on UI elements that need this functionality rather than having a case for it within the
ft-prompt
itself.This change should make it easier to add
ft-icon-button
s to a prompt in the future since they all userole="button"
.