Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/react-core/src/components/DataList/DataListCheck.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface DataListCheckProps extends Omit<React.HTMLProps<HTMLInputElemen
*/
defaultChecked?: boolean;
/** A callback for when the DataList checkbox selection changes */
onChange?: (checked: boolean, event: React.FormEvent<HTMLInputElement>) => void;
onChange?: (event: React.FormEvent<HTMLInputElement>, checked: boolean) => void;
/** Aria-labelledby of the DataList checkbox */
'aria-labelledby': string;
/** Flag to indicate if other controls are used in the DataListItem */
Expand All @@ -34,7 +34,7 @@ export interface DataListCheckProps extends Omit<React.HTMLProps<HTMLInputElemen
export const DataListCheck: React.FunctionComponent<DataListCheckProps> = ({
className = '',
// eslint-disable-next-line @typescript-eslint/no-unused-vars
onChange = (checked: boolean, event: React.FormEvent<HTMLInputElement>) => {},
onChange = (event: React.FormEvent<HTMLInputElement>, checked: boolean) => {},
isValid = true,
isDisabled = false,
isChecked = false,
Expand All @@ -48,7 +48,7 @@ export const DataListCheck: React.FunctionComponent<DataListCheckProps> = ({
<input
{...props}
type="checkbox"
onChange={event => onChange(event.currentTarget.checked, event)}
onChange={(event) => onChange(event, event.currentTarget.checked)}
aria-invalid={!isValid}
disabled={isDisabled}
{...([true, false].includes(defaultChecked) && { defaultChecked })}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ it('DataListCheck should match snapshot (auto-generated)', () => {
isDisabled={false}
isChecked={null}
checked={null}
onChange={(checked: boolean, event: React.FormEvent<HTMLInputElement>) => {}}
onChange={(event: React.FormEvent<HTMLInputElement>, checked: boolean) => {}}
aria-labelledby={'string'}
/>
);
Expand Down
Loading