mirror of
https://github.com/ansible/awx.git
synced 2026-01-22 06:58:06 -03:30
add id to code editor input fields
This commit is contained in:
parent
6dd5fc937b
commit
30f08582ed
@ -96,11 +96,15 @@ function CodeEditor({
|
||||
useEffect(
|
||||
function removeTextareaTabIndex() {
|
||||
const editorInput = editor.current.refEditor?.querySelector('textarea');
|
||||
if (editorInput && !readOnly) {
|
||||
if (!editorInput) {
|
||||
return;
|
||||
}
|
||||
if (!readOnly) {
|
||||
editorInput.tabIndex = -1;
|
||||
}
|
||||
editorInput.id = id;
|
||||
},
|
||||
[readOnly]
|
||||
[readOnly, id]
|
||||
);
|
||||
|
||||
const listen = useCallback(event => {
|
||||
@ -144,7 +148,7 @@ function CodeEditor({
|
||||
value={value}
|
||||
onFocus={onFocus}
|
||||
onBlur={onBlur}
|
||||
name={id || 'code-editor'}
|
||||
name={`${id}-editor` || 'code-editor'}
|
||||
editorProps={{ $blockScrolling: true }}
|
||||
fontSize={16}
|
||||
width="100%"
|
||||
|
||||
@ -167,7 +167,7 @@ function VariablesFieldInternals({
|
||||
<label htmlFor={id} className="pf-c-form__label">
|
||||
<span className="pf-c-form__label-text">{label}</span>
|
||||
</label>
|
||||
{tooltip && <Popover content={tooltip} id={id} />}
|
||||
{tooltip && <Popover content={tooltip} id={`${id}-tooltip`} />}
|
||||
</SplitItem>
|
||||
<SplitItem>
|
||||
<MultiButtonToggle
|
||||
@ -210,6 +210,7 @@ function VariablesFieldInternals({
|
||||
)}
|
||||
</FieldHeader>
|
||||
<CodeEditor
|
||||
id={id}
|
||||
mode={mode}
|
||||
readOnly={readOnly}
|
||||
{...field}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user