Query and Policy UI: Cursor placed at end of input field (#3224)

This commit is contained in:
RachelElysia 2021-12-07 15:17:56 -06:00 committed by GitHub
parent fde1da714b
commit 91a86ccee4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 0 deletions

View file

@ -315,6 +315,12 @@ const PolicyForm = ({
onChange={setLastEditedQueryName}
inputOptions={{
autoFocus: true,
onFocus: (e: React.FocusEvent<HTMLInputElement>) => {
// sets cursor to end of inputfield
const val = e.target.value;
e.target.value = "";
e.target.value = val;
},
}}
/>
);
@ -355,6 +361,12 @@ const PolicyForm = ({
onChange={setLastEditedQueryDescription}
inputOptions={{
autoFocus: true,
onFocus: (e: React.FocusEvent<HTMLInputElement>) => {
// sets cursor to end of inputfield
const val = e.target.value;
e.target.value = "";
e.target.value = val;
},
}}
/>
);
@ -398,6 +410,12 @@ const PolicyForm = ({
onChange={setLastEditedQueryResolution}
inputOptions={{
autoFocus: true,
onFocus: (e: React.FocusEvent<HTMLInputElement>) => {
// sets cursor to end of inputfield
const val = e.target.value;
e.target.value = "";
e.target.value = val;
},
}}
/>
</div>

View file

@ -307,6 +307,12 @@ const QueryForm = ({
onChange={setLastEditedQueryName}
inputOptions={{
autoFocus: true,
onFocus: (e: React.FocusEvent<HTMLInputElement>) => {
// sets cursor to end of inputfield
const val = e.target.value;
e.target.value = "";
e.target.value = val;
},
}}
/>
);
@ -347,6 +353,12 @@ const QueryForm = ({
onChange={setLastEditedQueryDescription}
inputOptions={{
autoFocus: true,
onFocus: (e: React.FocusEvent<HTMLInputElement>) => {
// sets cursor to end of inputfield
const val = e.target.value;
e.target.value = "";
e.target.value = val;
},
}}
/>
);