blockly-samples icon indicating copy to clipboard operation
blockly-samples copied to clipboard

Search bar should select all when focused

Open samelhusseini opened this issue 5 years ago • 1 comments

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

  1. Navigate to the plugins/workspace-search directory.
  2. Run npm run start.
  3. Click on the search bar on the workspace, and type some text into it.
  4. Click the workspace to unselect the search bar.
  5. Click the search bar again.
  6. Observe how the text you typed in is not selected, when it should be.

samelhusseini avatar Mar 25 '20 18:03 samelhusseini

Fixing this issue has a few steps:

  1. 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.
  2. Modify the code in plugins/workspace-search/src/WorkspaceSearch.js to call .select() on the input element when it is clicked.
  3. Run the reproduction steps again, and verify that the text is selected when you click on it.
  4. 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!

BeksOmega avatar Aug 09 '22 16:08 BeksOmega

Can I please work on this?

lucillewang avatar Sep 16 '22 16:09 lucillewang