downshift icon indicating copy to clipboard operation
downshift copied to clipboard

getToggleButtonProps is setting tabIndex of trigger to -1 and making it inaccessible

Open raza-jamil-reckon opened this issue 3 years ago • 0 comments

  • downshift version: 6.0.6
  • node version: 12.22.1
  • pnpm version: 5.18.9

Relevant code or config

  const {
    getToggleButtonProps,
  } = useCombobox({ ... });

return <><button {...getToggleButtonProps()}/></>

What you did: Use the useCombobox hook to get props for my trigger button using getToggleButtonProps.

What happened: The trigger button is inaccessible.

Reproduction repository: Repro can be observed in the docs site and screenshots below.

Problem description:

This is also the case on the docs website. When using the hook version, the trigger is inaccessible but when using the component version the trigger does not have tabIndex = -1. See snaps below:

Notice tabIndex = -1 when using the hook: Screen Shot 2022-08-19 at 9 42 46 am

Notice no tabIndex = -1 when using the component: Screen Shot 2022-08-19 at 9 43 17 am

Suggested solution:

I'm not sure why the trigger would have a negative tab index. I've fixed this temporarily by passing tabIndex = 0 in my app. Would like some clarification, not sure if I'm missing something.

raza-jamil-reckon avatar Aug 18 '22 23:08 raza-jamil-reckon