Skip to content

Commit

Permalink
fix: querySelector issue (#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
zernonia authored Sep 28, 2023
1 parent aacb3a2 commit bc5c458
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/radix-vue/src/Checkbox/CheckboxRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const checked = useVModel(props, 'checked', emits, {
const { primitiveElement, currentElement } = usePrimitiveElement()
// We set this to true by default so that events bubble to forms without JS (SSR)
const isFormControl = computed(() => currentElement.value ? Boolean(currentElement.value.closest('form')) : true)
const ariaLabel = computed(() => props.id && currentElement.value ? (document.querySelector(`[for=${props.id}]`) as HTMLLabelElement)?.innerText : undefined)
const ariaLabel = computed(() => props.id && currentElement.value ? (document.querySelector(`[for="${props.id}"]`) as HTMLLabelElement)?.innerText : undefined)
provide(CHECKBOX_INJECTION_KEY, {
disabled,
Expand Down
2 changes: 1 addition & 1 deletion packages/radix-vue/src/RadioGroup/Radio.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const context = inject(RADIO_GROUP_INJECTION_KEY)
const isFormControl = computed(() =>
triggerElement.value ? Boolean(triggerElement.value.closest('form')) : true,
)
const ariaLabel = computed(() => props.id && triggerElement.value ? (document.querySelector(`[for=${props.id}]`) as HTMLLabelElement)?.innerText : undefined)
const ariaLabel = computed(() => props.id && triggerElement.value ? (document.querySelector(`[for="${props.id}"]`) as HTMLLabelElement)?.innerText : undefined)
const hasConsumerStoppedPropagationRef = ref(false)
Expand Down
2 changes: 1 addition & 1 deletion packages/radix-vue/src/Switch/SwitchRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function toggleCheck() {
const { primitiveElement, currentElement } = usePrimitiveElement()
// We set this to true by default so that events bubble to forms without JS (SSR)
const isFormControl = computed(() => currentElement.value ? Boolean(currentElement.value.closest('form')) : true)
const ariaLabel = computed(() => props.id && currentElement.value ? (document.querySelector(`[for=${props.id}]`) as HTMLLabelElement)?.innerText : undefined)
const ariaLabel = computed(() => props.id && currentElement.value ? (document.querySelector(`[for="${props.id}"]`) as HTMLLabelElement)?.innerText : undefined)
provide<SwitchProvideValue>(SWITCH_INJECTION_KEY, {
checked,
Expand Down

0 comments on commit bc5c458

Please sign in to comment.