PropertyGridComponent from @itwin/property-grid-react calls onPropertyUpdated twice when you press TAB key (while editing a property). The two calls lead to some issues in our update implementation that uses EditCommands - you cannot start two overlapping EditCommands. This currently doesn't cause huge issues but our we end up showing this warning (when handling the second attempt to start EditCommand):
It also seems that onPropertyUpdated is called when focus is lost, this leads to some nasty error cycle if the first call throws and we want to show some kind of error alert UI - I'm guessing that error alert moves focus, onPropertyUpdated runs again, it errors out, we show an error alert again ...
Describe the bug
PropertyGridComponent
from@itwin/property-grid-react
callsonPropertyUpdated
twice when you press TAB key (while editing a property). The two calls lead to some issues in our update implementation that usesEditCommand
s - you cannot start two overlappingEditCommand
s. This currently doesn't cause huge issues but our we end up showing this warning (when handling the second attempt to startEditCommand
):It also seems that
onPropertyUpdated
is called when focus is lost, this leads to some nasty error cycle if the first call throws and we want to show some kind of error alert UI - I'm guessing that error alert moves focus,onPropertyUpdated
runs again, it errors out, we show an error alert again ...NOTE: There is a similar issue already: https://github.com/iTwin/appui/issues/915
To Reproduce
See sample code and resulting console logs:
Expected Behavior
No response
Screenshots
No response
Desktop (please complete the applicable information)
Reproduced in iTwin Studio, here are its versions:
Version: 1.0.63 (b7a3432) Build: iTwin Desktop Platform (Mango) 2024.07.10-2 iTwin.js: 4.7.4 iTwinUI: 3.10.0 AppUI: 4.12.0 React: 17.0.2 Node.js: 20.9.0 Electron: 29.1.0
Additional context
No response