-
Notifications
You must be signed in to change notification settings - Fork 8
v2: select rewrite #362
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
base: v2-migration
Are you sure you want to change the base?
v2: select rewrite #362
Changes from 7 commits
fb8e4e0
12c2e2a
8f7271e
29bef40
da8899a
fc4fe22
36a61aa
ac7d83c
b36776d
f5ca1b5
cc1f22d
2027206
b8c4ef5
8a5f63d
d3ed3fc
13de879
63b307b
851a350
47bad6a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import { Select } from "@qds.dev/ui"; | ||
| import { component$ } from "@qwik.dev/core"; | ||
|
|
||
| export default component$(() => { | ||
| return ( | ||
| <Select.Root> | ||
| <Select.Trigger>Trigger</Select.Trigger> | ||
| <Select.Content> | ||
| <Select.Item value="1">Item 1</Select.Item> | ||
| <Select.Item value="2">Item 2</Select.Item> | ||
| <Select.Item value="3">Item 3</Select.Item> | ||
| <Select.Item value="4">Item 4</Select.Item> | ||
| <Select.Item value="5">Item 5</Select.Item> | ||
| <Select.Item value="6">Item 6</Select.Item> | ||
| <Select.Item value="7">Item 7</Select.Item> | ||
| <Select.Item value="8">Item 8</Select.Item> | ||
| <Select.Item value="9">Item 9</Select.Item> | ||
| <Select.Item value="10">Item 10</Select.Item> | ||
| </Select.Content> | ||
| </Select.Root> | ||
| ); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import Basic from "./examples/basic"; | ||
|
|
||
| # Select | ||
|
|
||
| <Basic /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ import { popoverContextId } from "./popover-root"; | |
|
|
||
| export const PopoverTrigger = component$((props: PropsOf<"button">) => { | ||
| const context = useContext(popoverContextId); | ||
| const panelId = `${context.localId}-panel`; | ||
| const contentId = `${context.localId}-content`; | ||
|
|
||
| const handleClick = sync$((e: PointerEvent, el: HTMLElement) => { | ||
| const isHover = el.getAttribute("ui-hover") === "true"; | ||
|
|
@@ -17,15 +17,14 @@ export const PopoverTrigger = component$((props: PropsOf<"button">) => { | |
|
|
||
| return ( | ||
| <Render | ||
| ui-hover={context.hover} | ||
| ui-open={context.isOpen.value} | ||
| ui-closed={!context.isOpen.value} | ||
| {...props} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Hovered Popovers Fail Click PreventionThe |
||
| aria-expanded={context.isOpen.value} | ||
| internalRef={context.triggerRef} | ||
| popovertarget={panelId} | ||
| aria-controls={contentId} | ||
| popovertarget={contentId} | ||
| onClick$={[handleClick, props.onClick$]} | ||
| ui-qds-popover-trigger | ||
| fallback="button" | ||
| {...props} | ||
| > | ||
| <Slot /> | ||
| </Render> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| export { SelectContent as Content } from "./select-content"; | ||
| export { SelectRoot as Root } from "./select-root"; | ||
| export { SelectTrigger as Trigger } from "./select-trigger"; | ||
| export { SelectItem as Item } from "./select-item"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Hover Mode: Pointer Events Go Awry
When hover mode is enabled,
handlePointerMove$incorrectly chains withprops.onPointerOver$instead ofprops.onPointerMove$. This causes any user-providedonPointerMove$handler to be ignored in hover mode, while incorrectly calling theonPointerOver$handler on pointer move events.