Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix editor committing value twice when tab is pressed #942

Merged
merged 3 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/components-react",
"comment": "Fixed `EditorContainer` trying to commit updated value twice when tab is pressed.",
"type": "none"
}
],
"packageName": "@itwin/components-react"
}
3 changes: 2 additions & 1 deletion docs/changehistory/NextVersion.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Table of contents:
});
```

- `getIconClassName`, `getIconSpecFromDetails` methods of `MessageManager` class. Use [iTwinUI icons](https://itwinui.bentley.com} instead.
- `getIconClassName`, `getIconSpecFromDetails` methods of `MessageManager` class. Use [iTwinUI icons](https://itwinui.bentley.com) instead.
- `PropsHelper` class that is used internally. Use your custom helper functions instead.

- `CalculatorPopup` component and related props type `CalculatorPopupProps`. Use `Calculator` component with [iTwinUI Popover](https://itwinui.bentley.com/docs/popover) or `AccuDrawPopupManager.showCalculator` method instead. [#901](https://github.com/iTwin/appui/pull/901)
Expand Down Expand Up @@ -252,6 +252,7 @@ Table of contents:
- Fixed `activeMatchIndex` not working correctly on adjacent matches in `HighlightedText`. [#898](https://github.com/iTwin/appui/pull/898)
- Fixed widget tab styling to match the SVG and CSS icon size. [#901](https://github.com/iTwin/appui/pull/901)
- Fixed [mixed-decls](https://sass-lang.com/documentation/breaking-changes/mixed-decls/) Sass warnings. [#939](https://github.com/iTwin/appui/pull/939)
- Fixed `EditorContainer` trying to commit updated value twice when tab is pressed. [#942](https://github.com/iTwin/appui/pull/942)

## @itwin/core-react

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export function EditorContainer(props: EditorContainerProps) {
const onPressTab = (e: React.KeyboardEvent) => {
if (!propertyEditorRef.current?.containerHandlesTab) return;
e.stopPropagation();
e.preventDefault();
void handleContainerCommit();
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ describe("<EditorContainer />", () => {
title="abc"
onCommit={spyOnCommit}
onCancel={() => {}}
ignoreEditorBlur={true}
/>
);

Expand Down
Loading