Skip to content

Commit 5a37a13

Browse files
authored
fix: z-index of focused join items. closes: #4320
- revert `z-index: 1` on input and select Use the approach of increasing z-index for all direct children of `.join` that have focus inside. That way `.indicator` also works as expected (https://play.tailwindcss.com/LIjTRtOUTm?file=css). The other approach was to increase z-index for `.join-item` that has focus inside, but it will break when using `.indicator` (https://play.tailwindcss.com/G9kR2UpdSr?file=css). close #4320
1 parent c42d99e commit 5a37a13

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

packages/daisyui/src/components/input.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
outline: 2px solid var(--input-color);
4747
outline-offset: 2px;
4848
isolation: isolate;
49-
z-index: 1;
5049
}
5150

5251
/* increase font size in iOS so the page won't zoom */

packages/daisyui/src/components/select.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
outline: 2px solid var(--input-color);
6363
outline-offset: 2px;
6464
isolation: isolate;
65-
z-index: 1;
6665
}
6766

6867
&:has(> select[disabled]),

packages/daisyui/src/utilities/join.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,16 @@
6565
--join-ee: var(--radius-field);
6666
}
6767
}
68+
69+
> :where(:focus, :has(:focus)) {
70+
z-index: 1;
71+
}
72+
73+
@media (hover: hover) {
74+
> :where(.btn:hover, :has(.btn:hover)) {
75+
isolation: isolate;
76+
}
77+
}
6878
}
6979

7080
.join-item {

0 commit comments

Comments
 (0)