Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Submit input field when pressing Return (#1537)
Community-specific part of #897. Users can now submit a new hostname by pressing the “Return” key. It seems that the [`Element.click()` method](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click) is exactly what we need in terms of behaviour, and I thought it made more sense to make the implementation so that it “delegates” to the button click-handler, rather than repeating the internal logic of the latter. To me, the event handler would be expressive and straightforward enough to be inlined. I also added a brief explanation in the style guide, to capture our intent. <a data-ca-tag href="https://codeapprove.com/pr/tiny-pilot/tinypilot/1537"><img src="https://codeapprove.com/external/github-tag-allbg.png" alt="Review on CodeApprove" /></a>
- Loading branch information