Merge pull request #321 from lared/bugfix/tabbing-order

fix(#314): tabbing order through tables (variables etc) was inconsistent or impossible
This commit is contained in:
Anoop M D 2023-10-04 03:26:00 +05:30 committed by GitHub
commit 1932d98b57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 7 deletions

View File

@ -197,10 +197,11 @@ const AssertionRow = ({
<input <input
type="checkbox" type="checkbox"
checked={assertion.enabled} checked={assertion.enabled}
tabIndex="-1"
className="mr-3 mousetrap" className="mr-3 mousetrap"
onChange={(e) => handleAssertionChange(e, assertion, 'enabled')} onChange={(e) => handleAssertionChange(e, assertion, 'enabled')}
/> />
<button onClick={() => handleRemoveAssertion(assertion)}> <button tabIndex="-1" onClick={() => handleRemoveAssertion(assertion)}>
<IconTrash strokeWidth={1.5} size={20} /> <IconTrash strokeWidth={1.5} size={20} />
</button> </button>
</div> </div>

View File

@ -116,10 +116,11 @@ const FormUrlEncodedParams = ({ item, collection }) => {
<input <input
type="checkbox" type="checkbox"
checked={param.enabled} checked={param.enabled}
tabIndex="-1"
className="mr-3 mousetrap" className="mr-3 mousetrap"
onChange={(e) => handleParamChange(e, param, 'enabled')} onChange={(e) => handleParamChange(e, param, 'enabled')}
/> />
<button onClick={() => handleRemoveParams(param)}> <button tabIndex="-1" onClick={() => handleRemoveParams(param)}>
<IconTrash strokeWidth={1.5} size={20} /> <IconTrash strokeWidth={1.5} size={20} />
</button> </button>
</div> </div>

View File

@ -116,10 +116,11 @@ const MultipartFormParams = ({ item, collection }) => {
<input <input
type="checkbox" type="checkbox"
checked={param.enabled} checked={param.enabled}
tabIndex="-1"
className="mr-3 mousetrap" className="mr-3 mousetrap"
onChange={(e) => handleParamChange(e, param, 'enabled')} onChange={(e) => handleParamChange(e, param, 'enabled')}
/> />
<button onClick={() => handleRemoveParams(param)}> <button tabIndex="-1" onClick={() => handleRemoveParams(param)}>
<IconTrash strokeWidth={1.5} size={20} /> <IconTrash strokeWidth={1.5} size={20} />
</button> </button>
</div> </div>

View File

@ -115,10 +115,11 @@ const QueryParams = ({ item, collection }) => {
<input <input
type="checkbox" type="checkbox"
checked={param.enabled} checked={param.enabled}
tabIndex="-1"
className="mr-3 mousetrap" className="mr-3 mousetrap"
onChange={(e) => handleParamChange(e, param, 'enabled')} onChange={(e) => handleParamChange(e, param, 'enabled')}
/> />
<button onClick={() => handleRemoveParam(param)}> <button tabIndex="-1" onClick={() => handleRemoveParam(param)}>
<IconTrash strokeWidth={1.5} size={20} /> <IconTrash strokeWidth={1.5} size={20} />
</button> </button>
</div> </div>

View File

@ -123,10 +123,11 @@ const RequestHeaders = ({ item, collection }) => {
<input <input
type="checkbox" type="checkbox"
checked={header.enabled} checked={header.enabled}
tabIndex="-1"
className="mr-3 mousetrap" className="mr-3 mousetrap"
onChange={(e) => handleHeaderValueChange(e, header, 'enabled')} onChange={(e) => handleHeaderValueChange(e, header, 'enabled')}
/> />
<button onClick={() => handleRemoveHeader(header)}> <button tabIndex="-1" onClick={() => handleRemoveHeader(header)}>
<IconTrash strokeWidth={1.5} size={20} /> <IconTrash strokeWidth={1.5} size={20} />
</button> </button>
</div> </div>

View File

@ -128,10 +128,11 @@ const VarsTable = ({ item, collection, vars, varType }) => {
<input <input
type="checkbox" type="checkbox"
checked={_var.enabled} checked={_var.enabled}
tabIndex="-1"
className="mr-3 mousetrap" className="mr-3 mousetrap"
onChange={(e) => handleVarChange(e, _var, 'enabled')} onChange={(e) => handleVarChange(e, _var, 'enabled')}
/> />
<button onClick={() => handleRemoveVar(_var)}> <button tabIndex="-1" onClick={() => handleRemoveVar(_var)}>
<IconTrash strokeWidth={1.5} size={20} /> <IconTrash strokeWidth={1.5} size={20} />
</button> </button>
</div> </div>

View File

@ -66,6 +66,7 @@ class SingleLineEditor extends Component {
variables: getAllVariables(this.props.collection) variables: getAllVariables(this.props.collection)
}, },
scrollbarStyle: null, scrollbarStyle: null,
tabindex: 0,
extraKeys: { extraKeys: {
Enter: () => { Enter: () => {
if (this.props.onRun) { if (this.props.onRun) {
@ -104,7 +105,9 @@ class SingleLineEditor extends Component {
}, },
'Cmd-F': () => {}, 'Cmd-F': () => {},
'Ctrl-F': () => {}, 'Ctrl-F': () => {},
Tab: () => {} // Tabbing disabled to make tabindex work
Tab: false,
'Shift-Tab': false
} }
}); });
if (this.props.autocomplete) { if (this.props.autocomplete) {