themesberg / themesberg/flowbite-react
Dropdown: "disabled" attribute does not work when "renderTrigger"
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.1k
- Forks
- 506
- PR merge metrics
- No merged PRs in 30d
Description
- [x ] I have searched the Issues to see if this bug has already been reported
- [ x] I have tested the latest version
Steps to reproduce
I would want to have a custom span button, with dropdown attached.
Try this code:
return (
<Dropdown label="Dropdown button" disabled={true} renderTrigger={() =>
<span>[Custom Button]</span>
}>
<Dropdown.Item>Dashboard</Dropdown.Item>
<Dropdown.Item>Settings</Dropdown.Item>
<Dropdown.Item>Earnings</Dropdown.Item>
<Dropdown.Item>Sign out</Dropdown.Item>
</Dropdown>
);
Current behavior
In case disabled = {true}, the dropdown still appears when clicking.
Expected behavior
In case disabled = {true}, the dropdown should not appear.
Context
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Dropdown component's renderTrigger path and reproduce the issue with the provided disabled={true} example. Trace how clicks on the custom span are handled and verify that the dropdown does not appear when disabled is true.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100