flowbite-react icon indicating copy to clipboard operation
flowbite-react copied to clipboard

Dropdown: "disabled" attribute does not work when "renderTrigger"

Open tomphan opened this issue 1 year ago • 1 comments

  • [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

tomphan avatar Jan 31 '25 19:01 tomphan

Same for me. disabled={true} only works when not using renderTrigger

jerome-Dh avatar Mar 27 '25 00:03 jerome-Dh