File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 22 <label v-bind =" (ouiaProps as any)" :class =" styles.check" >
33 <input
44 v-bind =" $attrs"
5- :ref =" (el) => (el as HTMLInputElement).indeterminate = checked === null "
5+ :ref =" (el) => setIndeterminateState (el) "
66 :class =" styles.checkInput"
77 type =" checkbox"
88 :checked =" Boolean(checked)"
1212
1313<script lang="ts" setup>
1414import styles from ' @patternfly/react-styles/css/components/Check/check' ;
15- import { type InputHTMLAttributes } from ' vue' ;
15+ import { type ComponentPublicInstance , type InputHTMLAttributes } from ' vue' ;
1616import { useOUIAProps , type OUIAProps } from ' ../../helpers/ouia' ;
1717
1818defineOptions ({
@@ -30,4 +30,10 @@ const props = defineProps<Props>();
3030defineSlots <Record <string , never >>();
3131
3232const ouiaProps = useOUIAProps ({id: props .ouiaId , safe: props .ouiaSafe });
33+
34+ function setIndeterminateState(el : Element | ComponentPublicInstance | null ) {
35+ if (el instanceof HTMLInputElement ) {
36+ el .indeterminate = props .checked === null ;
37+ }
38+ }
3339 </script >
You can’t perform that action at this time.
0 commit comments