mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-06-12 15:57:12 +02:00
using id as form name for number and string component
This removes errors saying that quotes within element name are not allowed.
This commit is contained in:
@ -328,9 +328,7 @@ export const NumberComponent = React.memo((props: NumberComponentProps) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Set the cursor position after the component re-renders
|
// Set the cursor position after the component re-renders
|
||||||
const inputElement = document.getElementsByName(
|
const inputElement = document.getElementsByName(id)[0] as HTMLInputElement;
|
||||||
fullAccessPath
|
|
||||||
)[0] as HTMLInputElement;
|
|
||||||
if (inputElement && cursorPosition !== null) {
|
if (inputElement && cursorPosition !== null) {
|
||||||
inputElement.setSelectionRange(cursorPosition, cursorPosition);
|
inputElement.setSelectionRange(cursorPosition, cursorPosition);
|
||||||
}
|
}
|
||||||
@ -353,7 +351,7 @@ export const NumberComponent = React.memo((props: NumberComponentProps) => {
|
|||||||
value={inputString}
|
value={inputString}
|
||||||
disabled={readOnly}
|
disabled={readOnly}
|
||||||
onChange={() => {}}
|
onChange={() => {}}
|
||||||
name={fullAccessPath}
|
name={id}
|
||||||
onKeyDown={handleKeyDown}
|
onKeyDown={handleKeyDown}
|
||||||
onBlur={handleBlur}
|
onBlur={handleBlur}
|
||||||
className={isInstantUpdate && !readOnly ? 'instantUpdate' : ''}
|
className={isInstantUpdate && !readOnly ? 'instantUpdate' : ''}
|
||||||
|
@ -90,7 +90,7 @@ export const StringComponent = React.memo((props: StringComponentProps) => {
|
|||||||
</InputGroup.Text>
|
</InputGroup.Text>
|
||||||
<Form.Control
|
<Form.Control
|
||||||
type="text"
|
type="text"
|
||||||
name={fullAccessPath}
|
name={id}
|
||||||
value={inputString}
|
value={inputString}
|
||||||
disabled={readOnly}
|
disabled={readOnly}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
|
Reference in New Issue
Block a user