Fix when enter a URL in button block#6915
Conversation
|
Hi @Rahmon, this seems like a reasonable fix but needs rebased. If you're up for that, I can review after. |
|
Hi @brandonpayton. I'll update this PR to check if this issue still happening. |
|
Some additional info: |
|
@designsimply is that still an issue? I see that all linked references are already closed. |
|
I re-tested and found that the problem raised in #6841 where you cannot hit enter to accept a domain added to the URL input in the link inserter for the button block is still a problem. #6841 was closed to consolidate with #1838 which was a different issue requesting that validation and feedback be added for the URL input field and which was fixed by #11835 and two additional PRs were split out to address separate concerns about visual formatting for invalid links in #11793 and #11796. I re-opened #6841 because it has not yet been addressed and added a note to say updating the button block link inserter to use the In summary, I think we can close this PR in favor of updating to |
Description
UrlInput component was selecting the first search result in Button Block (and probably in other blocks).
This happened because onKeyDown event at input just check if some suggestion was selected when Enter key is press.
Consequently, how suggested posts are buttons inside a form, the onClick event of first button get fired and set the link.
I also moved prependHTTP function from format-toolbar.js to url-input.js. Otherwise I need to repeat the same function in Button Block.
Closes: #6841
How has this been tested?
This has been tested with "npm test" and manually on Chrome
Types of changes
Bug fix
Checklist: