blockly-samples
blockly-samples copied to clipboard
Search bar should select all when focused
Is your feature request related to a problem? Please describe.
Search bar should select all when the bar is focused.
Describe the solution you'd like
Similar behaviour to other search bars, if there's content in the search bar, its selected so when a user types its replaced.
Steps to Reproduce
- Navigate to the
plugins/workspace-searchdirectory. - Run
npm run start. - Click on the search bar on the workspace, and type some text into it.
- Click the workspace to unselect the search bar.
- Click the search bar again.
- Observe how the text you typed in is not selected, when it should be.
Fixing this issue has a few steps:
- Reproduce the issue using the steps outlined in the "Steps to Reproduce" section. Once you can reproduce the bad behavior, you can test if your changes fixed it.
- Modify the code in plugins/workspace-search/src/WorkspaceSearch.js to call
.select()on the input element when it is clicked. - Run the reproduction steps again, and verify that the text is selected when you click on it.
- Open your PR and resolve any PR comments.
After your PR is accepted, a Blockly team member will have to publish the GitHub Pages site, and then you'll be able to see your change live!
Can I please work on this?