@itwin/itwinui-react 2.12.20 → 2.12.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/cjs/core/Dialog/DialogMain.js +2 -24
- package/cjs/styles.js +1 -1
- package/esm/core/Dialog/DialogMain.js +3 -25
- package/esm/styles.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.12.22
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 20b627b4: Fixed an issue where `Table` was showing a dummy vertical scrollbar track inside the table header in Chromium 121 + Windows.
|
|
8
|
+
- 66bddba3: Fixed `Surface.Body` not being visually aligned with `Surface.Header` depending on scrollbar visibility.
|
|
9
|
+
|
|
10
|
+
## 2.12.21
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 764d16fb: Fixed blurring and resizing issues in Dialog/Modal by removing `overflow: hidden` and inline `transform` styles.
|
|
15
|
+
|
|
3
16
|
## 2.12.20
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -64,7 +64,6 @@ exports.DialogMain = React.forwardRef((props, ref) => {
|
|
|
64
64
|
(0, index_js_1.useTheme)();
|
|
65
65
|
const [style, setStyle] = React.useState();
|
|
66
66
|
const dialogRef = React.useRef(null);
|
|
67
|
-
const [dialogElement, setDialogElement] = React.useState();
|
|
68
67
|
const hasBeenResized = React.useRef(false);
|
|
69
68
|
const previousFocusedElement = React.useRef();
|
|
70
69
|
const originalBodyOverflow = React.useRef('');
|
|
@@ -137,17 +136,13 @@ exports.DialogMain = React.forwardRef((props, ref) => {
|
|
|
137
136
|
...newStyle,
|
|
138
137
|
}));
|
|
139
138
|
}, []);
|
|
140
|
-
const roundedTransform = useRoundedTransform({
|
|
141
|
-
element: dialogElement,
|
|
142
|
-
transform,
|
|
143
|
-
});
|
|
144
139
|
const content = (React.createElement("div", { className: (0, classnames_1.default)('iui-dialog', {
|
|
145
140
|
'iui-dialog-default': styleType === 'default',
|
|
146
141
|
'iui-dialog-full-page': styleType === 'fullPage',
|
|
147
142
|
'iui-dialog-visible': isOpen,
|
|
148
143
|
'iui-dialog-draggable': isDraggable,
|
|
149
|
-
}, className), role: 'dialog', ref: (0, index_js_1.useMergedRefs)(dialogRef, ref
|
|
150
|
-
transform: styleType !== 'fullPage' ?
|
|
144
|
+
}, className), role: 'dialog', ref: (0, index_js_1.useMergedRefs)(dialogRef, ref), onKeyDown: handleKeyDown, tabIndex: -1, "data-iui-placement": placement, style: {
|
|
145
|
+
transform: styleType !== 'fullPage' ? transform : undefined,
|
|
151
146
|
...style,
|
|
152
147
|
...propStyle,
|
|
153
148
|
}, ...rest },
|
|
@@ -180,20 +175,3 @@ exports.DialogMain = React.forwardRef((props, ref) => {
|
|
|
180
175
|
!trapFocus && content)));
|
|
181
176
|
});
|
|
182
177
|
exports.default = exports.DialogMain;
|
|
183
|
-
// ----------------------------------------------------------------------------
|
|
184
|
-
/**
|
|
185
|
-
* Rounds off an element's transform value based on the device's pixel grid, to avoid blurring.
|
|
186
|
-
*/
|
|
187
|
-
const useRoundedTransform = ({ element, transform, }) => {
|
|
188
|
-
const [roundedStyles, setRoundedStyles] = React.useState(transform);
|
|
189
|
-
(0, index_js_1.useIsomorphicLayoutEffect)(() => {
|
|
190
|
-
if (!element || typeof DOMMatrix === 'undefined') {
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
const [x, y] = transform
|
|
194
|
-
? (0, index_js_1.getTranslateValues)(transform)
|
|
195
|
-
: (0, index_js_1.getTranslateValuesFromElement)(element);
|
|
196
|
-
setRoundedStyles(`translate(${(0, index_js_1.roundByDPR)(x)}px, ${(0, index_js_1.roundByDPR)(y)}px)`);
|
|
197
|
-
}, [element, transform]);
|
|
198
|
-
return roundedStyles;
|
|
199
|
-
};
|