Skip to content

Commit

Permalink
Submit on enter
Browse files Browse the repository at this point in the history
  • Loading branch information
thecalcc committed Oct 24, 2023
1 parent 5daade9 commit ee9f11b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/core/editor3/components/links/LinkInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export class LinkInputComponent extends React.Component<IProps, any> {
const _applyLink = this.props.applyLink;
const _changeLinkSuggestion = this.props.changeLinkSuggestion;

debugger;
if (linkType === linkTypes.href) {
const url = this.state.url;
const isLocalDomain = (localDomains || []).some((item) => url.includes(item.domain));
Expand Down Expand Up @@ -188,6 +189,11 @@ export class LinkInputComponent extends React.Component<IProps, any> {
>
<div style={{padding: '3.2rem 1.6rem'}}>
<input
onKeyDown={(e) => {
if (e.key === 'Enter') {
this.onSubmit(linkTypes.href);
}
}}
type="url"
ref={(el) => {
this.inputElement = el;
Expand Down

0 comments on commit ee9f11b

Please sign in to comment.