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

Clear invalid label tags #4591

Merged
merged 5 commits into from
Mar 30, 2024
Merged

Clear invalid label tags #4591

merged 5 commits into from
Mar 30, 2024

Conversation

perryr16
Copy link
Contributor

Any background context you want to provide?

The label filters (and, or, exclude) are based attached to the model via a <tags-input> and <auto-complete> elements. If a valid label is selected, its value is attached to the <tags-input>'s ng-model. If invalid text is entered, it is not attached to the ng-model and not available to reset in $scope. This makes clearing the text difficult.

What's this PR do?

After resetting the ng-model's labels, the trashcan icon will also re-render the <tags-input> element, clearing any remaining text.

It's a little hacky, but it's cleaner than trying to locate the correct HTML element within , clear its contents, and convince the element that it is now in a 'valid' state.

How should this be manually tested?

Add a few labels. Filter on those labels. Add some random text to the filter fields. Hit the trash icon.

What are the relevant tickets?

#4305

Screenshots (if appropriate)

Screen.Recording.2024-03-27.at.10.37.18.AM.mov

@perryr16 perryr16 added the Bug label Mar 27, 2024
@perryr16 perryr16 marked this pull request as ready for review March 27, 2024 17:12
Copy link
Member

@nllong nllong left a comment

Choose a reason for hiding this comment

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

worked for me!

@nllong nllong merged commit c992986 into develop Mar 30, 2024
8 checks passed
@nllong nllong deleted the 4305-clear-inv-list-label-filter branch March 30, 2024 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants