-
Notifications
You must be signed in to change notification settings - Fork 21
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
added event keydown to prevent < or > #433
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution, we really appreciate it! 😄
packages/x-components/src/x-modules/search-box/components/search-input.vue
Outdated
Show resolved
Hide resolved
packages/x-components/src/x-modules/search-box/components/__tests__/search-input.spec.ts
Outdated
Show resolved
Hide resolved
deleted the .parcel-cache files
…ed to add test for beforeinput
packages/x-components/src/x-modules/search-box/components/search-input.vue
Show resolved
Hide resolved
…om being searched
…query from being searched" This reverts commit 1b3bda4.
Hey @javieri-empathy! I have currently added the cypress add to test the typing of the special characters. For the pasting and using url with search query, I have kept the keydown method to remove the special characters as it prevents the user from further typing or pressing enter. If I keep this functionality, then we will be able to test this behavior with jest. I believe this solves both cases. If there is a problem please let me know! |
@wannieman98 I've took a look and I think you can just rely on Please, don't forget to rollback the parcel-cache files 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job, thanks for the contribution! ;)
packages/x-components/src/x-modules/search-box/components/search-input.vue
Outdated
Show resolved
Hide resolved
packages/x-components/src/x-modules/search-box/components/search-input.vue
Outdated
Show resolved
Hide resolved
packages/x-components/src/x-modules/search-box/components/search-input.vue
Outdated
Show resolved
Hide resolved
packages/x-components/src/x-modules/search-box/components/search-input.vue
Outdated
Show resolved
Hide resolved
…ch-input.vue Co-authored-by: Diego Pascual <[email protected]>
…ch-input.vue Co-authored-by: Diego Pascual <[email protected]>
Hi @diegopf, thanks for the review! I have made the requested changes as well as rolling back the parcel-caches as well as the removing the jest tests. I have ran merged with the main branch in the repo and ran the tests! If there is any problem please let me know, I'd appreciate it. |
a78990f
For the search input in the search box module, I added a keydown event to replace special characters '<' and '>' whenever a user typed that into the search input box.
Pull request template
This PR is meant to improve and add a feature to an existing search input module. In detail, a function has been added that will check if the input query contains a '<' or a '>' and if it exists replace it with ''. This PR fixes #383.
Motivation and context
Type of change
What is the destination branch of this PR?
Main
How has this been tested?
Tests performed according to testing guidelines: In order to test the feature that I implemented work, I gave mock search input several varying string values that has special characters '<' and '>' around the string "water". Using a for loop, checked whether the search feature properly eliminated the special characters and return the string "water". This code should not affect other areas of code.
Checklist: