mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-06-11 07:47: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(() => {
|
||||
// Set the cursor position after the component re-renders
|
||||
const inputElement = document.getElementsByName(
|
||||
fullAccessPath
|
||||
)[0] as HTMLInputElement;
|
||||
const inputElement = document.getElementsByName(id)[0] as HTMLInputElement;
|
||||
if (inputElement && cursorPosition !== null) {
|
||||
inputElement.setSelectionRange(cursorPosition, cursorPosition);
|
||||
}
|
||||
@ -353,7 +351,7 @@ export const NumberComponent = React.memo((props: NumberComponentProps) => {
|
||||
value={inputString}
|
||||
disabled={readOnly}
|
||||
onChange={() => {}}
|
||||
name={fullAccessPath}
|
||||
name={id}
|
||||
onKeyDown={handleKeyDown}
|
||||
onBlur={handleBlur}
|
||||
className={isInstantUpdate && !readOnly ? 'instantUpdate' : ''}
|
||||
|
@ -90,7 +90,7 @@ export const StringComponent = React.memo((props: StringComponentProps) => {
|
||||
</InputGroup.Text>
|
||||
<Form.Control
|
||||
type="text"
|
||||
name={fullAccessPath}
|
||||
name={id}
|
||||
value={inputString}
|
||||
disabled={readOnly}
|
||||
onChange={handleChange}
|
||||
|
Reference in New Issue
Block a user