Added onIconClick
to extension search input
#9767
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When searching for extensions in the Minecraft target, clicking on the magnifying glass icon on the right of the search bar wouldn't do anything. It was unclear to me why it was behaving differently. As far as I could tell, there weren't any flags that would set this in the target itself and when inspecting the html, everything looked the same as it does in arcade, where clicking the icon will kick off a search as expected.
Adding the
onIconClick
field to the input does change the icon into a button, but I think this is a fine change. I actually think that this modification makes it clearer that the icon can be clicked since it comes with the css that we have defined for common-buttons (pointer and darker background color on hover).This is a quick video showing how it looks as only an icon and then now as a button:
arcade-search-extensions.mp4
Here's a target in Minecraft: https://minecraft.makecode.com/app/cc86807a84f344ed00a69ca22a3c95f31105b02f-3cdea2d8d6#
This includes some css changes that I made to the button to make it look the same as the other targets. I'm opening another PR in Minecraft to get those changes.
Fixes https://github.com/microsoft/pxt-minecraft/issues/2392