Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outline checkbox button has incorrect focus state #36502

Closed
3 tasks done
LocalHeroPro opened this issue Jun 4, 2022 · 10 comments · Fixed by #37026
Closed
3 tasks done

Outline checkbox button has incorrect focus state #36502

LocalHeroPro opened this issue Jun 4, 2022 · 10 comments · Fixed by #37026

Comments

@LocalHeroPro
Copy link

Prerequisites

Describe the issue

When we use Checkbox with outlined style
https://getbootstrap.com/docs/5.2/forms/checks-radios/#outlined-styles
When checkbox is selected and we click on that checkbox to unselect it, selecting color still appear and to see changes - no color inside button - we need to click somewhere else.
If wee still clicking on same checkbox, we have selected color inside checkbox. No changes appears.
It's annoying.

Reduced test cases

Single toggle

What operating system(s) are you seeing the problem on?

Linux

What browser(s) are you seeing the problem on?

Chrome, Firefox, Opera

What version of Bootstrap are you using?

5.2

@LocalHeroPro LocalHeroPro changed the title Checkbox don Checkbox do't change color when clicking on it Jun 4, 2022
@LocalHeroPro LocalHeroPro changed the title Checkbox do't change color when clicking on it Checkbox don't change color when clicking on it Jun 4, 2022
@RedHeadphone
Copy link

The issue is with :focus in .btn-check right?

@RedHeadphone
Copy link

I would like to fix it

@mdo
Copy link
Member

mdo commented Jun 14, 2022

Duplicate of #31149.

@mdo mdo closed this as not planned Won't fix, can't repro, duplicate, stale Jun 14, 2022
@RedHeadphone
Copy link

@mdo but this issue is related to :focus and not :hover

@mdo mdo reopened this Jun 14, 2022
@mdo
Copy link
Member

mdo commented Jun 14, 2022

Ah yup, sorry! Will review again, I think I found when and why this bug/change was introduced thanks to your PR.

@mdo
Copy link
Member

mdo commented Jun 14, 2022

This was changed in #34600 with the rewrite of our buttons to use CSS variables. We moved a ton of source SCSS from the mixin into the main .btn base class, which included some styles that were specific to .btn-* modifiers and not .btn-outline-* modifiers. Will need a little time to think about a solution here.

@RedHeadphone
Copy link

yeah I see in mixin button-outline-variant only the following css was applied on focus

  .btn-check:focus + &,
  &:focus {
    box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
  }

How should I fix this? Can you lead me a way?

@mdo mdo added this to To do in v5.2.0-stable via automation Jun 15, 2022
@mdo mdo changed the title Checkbox don't change color when clicking on it Outline checkbox button has incorrect focus state Jun 15, 2022
@RedHeadphone
Copy link

RedHeadphone commented Jun 17, 2022

Do I move back specific CSS for .btn-* and .btn-outline-* back to mixin? or is there better way to do it? @mdo

@mdo mdo removed this from To do in v5.2.0-stable Jul 11, 2022
@mdo mdo added this to To do in v5.3.0 via automation Jul 11, 2022
@Aliyosign
Copy link

hey
am interested in this task , how do l go ahead?

@florianlacreuse
Copy link
Contributor

You should read the readme and the contributing guidelines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v5.3.0
To do
5 participants