-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
refactor(checkbox): update component #432
Conversation
Thank you for following the naming conventions! 🙏 |
@@ -32,16 +33,11 @@ const popoverAnchor = defineComponent({ | |||
|
|||
return () => h(OkuPopperAnchor, { | |||
...popperScope, | |||
...mergeProps(attrs, reactiveAnchorProps), | |||
...mergeProps(attrs, otherProps), |
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.
Don't we need to add emits, you stopped coming up here? useListener()
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.
Will do it in a separate PR, I did not focus or edit much in the other components except the render function.
Thank you for this great work ❤️ |
@@ -40,7 +40,7 @@ const Checkbox = defineComponent({ | |||
const composedRefs = useComposedRefs(forwardedRef, buttonRef) | |||
const hasConsumerStoppedPropagationRef = ref(false) | |||
// We set this to true by default so that events bubble to forms without JS (SSR) | |||
const isFormControl = computed(() => buttonRef.value ? Boolean(buttonRef.value?.closest('form')) : true) | |||
const isFormControl = computed(() => buttonRef.value instanceof HTMLElement ? Boolean(buttonRef.value.closest('form')) : false) |
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.
@productdevbook I accidentally changed this to false when I was fixing the vitest issue. Do you know why this happened when it is set to true?
vitest caught 1 unhandled error during the test run.
This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.
buttonRef.value?.closest is not a function
❯ ReactiveEffect.fn packages/components/checkbox/src/checkbox.ts:43:85
41| const hasConsumerStoppedPropagationRef = ref(false)
42| // We set this to true by default so that events bubble to forms without JS (SSR)
43| const isFormControl = computed(() => buttonRef.value ? Boolean(buttonRef.value?.closest('form')) : tr…
Description
Linked Issues
#358
Additional context