ljmotta commented on PR #2254:
URL:
https://github.com/apache/incubator-kie-tools/pull/2254#issuecomment-2072075991
@jomarko To use the `onBlur` you will need to create a new `width` and
`height` states to be used by the `TextInput` field.
```ts
const [width, setWidth] = useState<number>(boundWidth);
const [height, setHeight] = useState<number>(boundHeight);
```
With this in place, you can change the `onChange={onChangeWidth}` and
`onChange={onChangeHeight}` to `onBlur={onBlurWidth}` and
`onBlur={onBlurHeight}`. The `value` and `onChange` on the `TextInput` will be:
```
value={isDimensioningEnabled ? width : undefined}
onChange={(newWidth) => setWidth(+newWidth)}
```
On the `onBlurWidth` you will use the `width` state instead of the callback
parameter to set the bounds, or you will reset the `width` state to the minimal
value.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]