Skip to content

Commit 85b589a

Browse files
committed
fix(Dialog): focus first element logic
1 parent 2d670d4 commit 85b589a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/components/overlays/Dialog/Dialog.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,16 @@ const CLOSE_BUTTON_STYLES: Styles = {
9595
width: '5x',
9696
height: '5x',
9797
placeContent: 'center',
98+
fill: {
99+
'': '#dark.0',
100+
hovered: '#dark.04',
101+
pressed: '#dark.05',
102+
},
103+
color: {
104+
'': '#dark-02',
105+
hovered: '#dark-02',
106+
pressed: '#purple',
107+
},
98108
};
99109

100110
const sizeMap = {
@@ -206,7 +216,9 @@ const DialogContent = forwardRef(function DialogContent(
206216
if (contextProps.isOpen) {
207217
setTimeout(() => {
208218
focusManager?.focusFirst();
209-
setIsCloseDisabled(false);
219+
setTimeout(() => {
220+
setIsCloseDisabled(false);
221+
}, 250);
210222
});
211223
} else {
212224
setIsCloseDisabled(true);

0 commit comments

Comments
 (0)