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

Fix spacing issue in Settings Search input #17108

Merged
merged 3 commits into from
Jan 9, 2023
Merged

Fix spacing issue in Settings Search input #17108

merged 3 commits into from
Jan 9, 2023

Conversation

ryanml
Copy link
Contributor

@ryanml ryanml commented Jan 9, 2023

Fix: #17100

Explanation

This bug was introduced in #16903 with the use of .trim(). As input is sanitized upon entry, always trimming the trailing whitespace will result in the denial of space entry. Using trimStart() will produce the desired effect of preventing leading whitespaces, while still allowing for normal space entry in between query terms.

Screenshots/Screencaps

Before

(Space key doesn't work)

before.mov

After

fix-17100.mov

Manual Testing Steps

  1. Click to Settings
  2. Attempt to enter a query containing spaces, such as currency conversion
  3. Ensure that the query can be entered as expected with spaces

Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving
    • How this problem was solved
    • How reviewers can test my changes
  • Sufficient automated test coverage has been added

Pre-merge reviewer checklist

  • Manual testing (e.g. pull and build branch, run in browser, test code being changed)
  • PR is linked to the appropriate GitHub issue
  • IF this PR fixes a bug in the release milestone, add this PR to the release milestone

If further QA is required (e.g. new feature, complex testing steps, large refactor), add the Extension QA Board label.

In this case, a QA Engineer approval will be be required.

@ryanml ryanml requested a review from a team as a code owner January 9, 2023 18:26
@ryanml ryanml self-assigned this Jan 9, 2023
Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

Code LGTM! Took the liberty of adding a "before" video showing the space key not working

@metamaskbot
Copy link
Collaborator

Builds ready [b6526e3]
Page Load Metrics (1402 ± 122 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint97146117147
domContentLoaded114821801379249119
load114821811402254122
domInteractive114821801379249119
Bundle size diffs
  • background: 0 bytes
  • ui: 5 bytes
  • common: 0 bytes

highlights:

storybook

@ryanml ryanml merged commit 64eae7d into develop Jan 9, 2023
@ryanml ryanml deleted the fix-17100 branch January 9, 2023 20:54
@github-actions github-actions bot locked and limited conversation to collaborators Jan 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Cannot add a space on Settings Search
4 participants