Skip to content

Conversation

DamianGlowala
Copy link
Contributor

This correctly inferes types from passed modelValue and avoids type issues for those who e.g. do not need the indeterminate state.

Copy link

pkg-pr-new bot commented Sep 5, 2025

Open in StackBlitz

npm i https://pkg.pr.new/reka-ui@2145

commit: 1645167

@DamianGlowala
Copy link
Contributor Author

@sadeghbarati do you have any idea if the test failure is related to this PR (which only changes types)?

@sadeghbarati
Copy link
Collaborator

sadeghbarati commented Sep 11, 2025

Hi, sry for late response

Yes the types is become runtime thing after Vue compiler, compiles the template

Vue SFC Playground

export type CheckedState = boolean | 'indeterminate'

export interface CheckboxRootProps<T extends CheckedState = CheckedState> {
  defaultValue?: T
  defaultValueTwo?: boolean | 'indeterminate'
}

const props = defineProps<CheckboxRootProps<T>>()

this will become

props: {
  defaultValue: { type: null, required: false },
  defaultValueTwo: { type: [Boolean, String], required: false }
},

generic type will become null in runtime instead of [Boolean, String] and aria-checked test will fail because type is null
aria-checked must have nullable check for checkboxState

Asking AI for this check returned this

:aria-checked="isIndeterminate(checkboxState) 
  ? 'mixed' 
  : checkboxState === true 
    ? 'true' 
    : 'false'"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants