fix: adding a simple fix for entering to send a request (#4868)

* add hack

* adding the empty string check else where

* limiting the event scope

This merge will close the following draft PR for its spike work as well.
This commit is contained in:
Mark Kim
2022-06-15 14:41:57 -04:00
committed by GitHub
parent b24d30a21d
commit 3edef836c6

View File

@@ -142,6 +142,11 @@ export class RequestUrlBar extends PureComponent<Props, State> {
return;
}
if (event.code === 'Enter' && this.props.request.url) {
this._handleSend();
return;
}
executeHotKey(event, hotKeyRefs.REQUEST_FOCUS_URL, () => {
this._input?.focus();
this._input?.selectAll();
@@ -359,7 +364,7 @@ export class RequestUrlBar extends PureComponent<Props, State> {
const { url, method } = request;
return (
<KeydownBinder onKeydown={this._handleKeyDown}>
<KeydownBinder onKeydown={this._handleKeyDown} scoped>
<div className="urlbar">
<MethodDropdown
ref={this._setMethodDropdownRef}