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

Source selection is not filtering when ) is in source name #1312

Open
jrusz opened this issue Aug 15, 2023 · 4 comments
Open

Source selection is not filtering when ) is in source name #1312

jrusz opened this issue Aug 15, 2023 · 4 comments

Comments

@jrusz
Copy link
Collaborator

jrusz commented Aug 15, 2023

The source selection in image creation wizard is not filtering the items properly if the source name has a ) in the name, see screenshots.

image
image

@ezr-ondrej
Copy link
Collaborator

Ok, found the issue, it is in PF4 itself.

https://github.com/patternfly/patternfly-react/blob/63b1d08cf7c4f02d32d5473db74f6f7ac0af88af/packages/react-core/src/components/Select/Select.tsx#L461

When the input value is a valid regex, it's treated as a regex, so I guess in case with My (source) we would need to escape the input as My \(source\) ... workaround would be to implement the filter ourselves.

It would not be easy to get a fix in patternfly given they do not support this version anymore.

@lavocatt
Copy link
Contributor

Is it a bug in patternfly or a valid behavior ? Just by a the look of it it could be both IMO, the code tries to check if the text is a valid regex pattern and to use it that way and if not to escape all regex special characters.

The question is, do we want to let the user use regexs in the UI or not ?
If not, we could simply escape the string before it goes to patternfly ?

@lavocatt
Copy link
Contributor

image
I think also that it's kinda neat to have the ability to filter on using a regex :)

@ezr-ondrej
Copy link
Collaborator

We would need to implement the search ourselves completely, there is no hook into the default implementation, either we reimplement, or we use default :)

I think it's a feature, but should be documented 😛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants