Skip to content

Commit f004d05

Browse files
Gregor WoiwodeGregor Woiwode
Gregor Woiwode
authored and
Gregor Woiwode
committed
chore(tailwind:dialog): remove autoFocus since it does not work
1 parent 1d941cf commit f004d05

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

apps/website/src/routes/docs/tailwind/(components)/dialog/examples.tsx

+6-9
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ export const Example02 = component$(() => {
3636
return (
3737
<PreviewCodeExample>
3838
<div q:slot="actualComponent">
39-
<Button onClick$={() => dialogRef.value?.open()}>Open Dialog</Button>
39+
<Button autoFocus onClick$={() => dialogRef.value?.open()}>
40+
Open Dialog
41+
</Button>
4042

4143
<Dialog.Root ref={dialogRef}>
4244
<Dialog.Header>
@@ -46,9 +48,7 @@ export const Example02 = component$(() => {
4648
<p id="dialog-text">Do you agree to the terms our services?</p>
4749
</Dialog.Content>
4850
<Dialog.Footer>
49-
<Button onClick$={() => dialogRef.value?.close()} autoFocus>
50-
Disagree
51-
</Button>
51+
<button onClick$={() => dialogRef.value?.close()}>Disagree</button>
5252
<Button onClick$={() => dialogRef.value?.close()}>Agree</Button>
5353
</Dialog.Footer>
5454
</Dialog.Root>
@@ -74,13 +74,10 @@ export const Example_FullScreen = component$(() => {
7474
<h2 id="dialog-heading">Hello 👋</h2>
7575
</Dialog.Header>
7676
<Dialog.Content>
77-
<p id="dialog-text">Do you agree to the terms our services?</p>
77+
<p id="dialog-text">I am a simple Dialog.</p>
7878
</Dialog.Content>
7979
<Dialog.Footer>
80-
<Button onClick$={() => dialogRef.value?.close()} autoFocus>
81-
Disagree
82-
</Button>
83-
<Button onClick$={() => dialogRef.value?.close()}>Agree</Button>
80+
<Button onClick$={() => dialogRef.value?.close()}>Close</Button>
8481
</Dialog.Footer>
8582
</Dialog.Root>
8683
</div>

packages/kit-headless/src/components/dialog/dialog.root.css

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
height: 100vh;
44
}
55

6+
/**
7+
* Dialog was not stretching over the whole screen.
8+
* Found an answer on StackOverflow that works:
9+
* https://stackoverflow.com/a/75024226/1648207
10+
*/
611
.full-screen:modal {
712
max-width: 100vw;
8-
height: 100vh;
913
}

0 commit comments

Comments
 (0)