flowbite icon indicating copy to clipboard operation
flowbite copied to clipboard

Indeterminate Checkbox should not change on hover if disabled.

Open herronelou opened this issue 1 year ago • 0 comments

Describe the bug With Flowbite, only indeterminate checkboxes have a different style on hover. While inconsistent, this doesn't bother me, however, these checkboxes preserve this behaviour even when disabled, which makes them look like they can be interacted with, which I believe is against UI best practices enough to constitute a bug.

I believe the CSS selector on https://github.com/themesberg/flowbite/blob/main/plugin.js#L364 could be changed to:

[type='checkbox']:indeterminate:not(:disabled):hover,
[type='checkbox']:indeterminate:not(:disabled):focus {
  border-color: transparent;
  background-color: currentColor;
}

I did not open a PR because maybe you would prefer to fix it a different way (maybe removing the hover entirely since none of the other checkboxes have them), and I haven't forked the repo so far.

To Reproduce Steps to reproduce the behavior:

  1. Create a disabled indeterminate checkbox
  2. Move you mouse over it

Expected behavior Disabled elements should not change on hover

Screenshots Not hover: image Hover: image

herronelou avatar Apr 08 '24 00:04 herronelou