fix(#312): tabbing order through tables (variables etc) was inconsistent or impossible

resolves #312
This commit is contained in:
Michał Szymborski 2023-10-03 21:24:59 +02:00
parent 2e600838b2
commit 494b484cd9
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) {