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

Invisible focus outline in chrome for button element #38903

Open
3 tasks done
vovochka-dev opened this issue Jul 14, 2023 · 2 comments
Open
3 tasks done

Invisible focus outline in chrome for button element #38903

vovochka-dev opened this issue Jul 14, 2023 · 2 comments
Labels

Comments

@vovochka-dev
Copy link

Prerequisites

Describe the issue

The element is typically expected to display an outline when it receives focus. However, in some cases, the default styling of buttons, particularly in Bootstrap, hides the outline for buttons. As a result, the outline is not visible when a button receives focus, and this behavior is observed in certain browsers like Chrome.

While it may be a browser-specific issue, there are ways to address this problem within the context of Bootstrap.

It's because In _reboot.scss we set:

button {
  border-radius: 0;
}

Reduced test cases

In Bootstrap
https://codepen.io/vovochka-dev/pen/PoxQvoY

Without Bootstrap
https://codepen.io/vovochka-dev/pen/RwqQmaz

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

Windows

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

Chrome

What version of Bootstrap are you using?

5.3.0

@julien-deramond
Copy link
Member

Thanks for submitting this issue @vovochka-dev.
I'm not sure to understand what's the issue here. Are you using the buttons without Bootstrap CSS?

@vovochka-dev
Copy link
Author

vovochka-dev commented Jul 15, 2023

Thanks for submitting this issue @vovochka-dev. I'm not sure to understand what's the issue here. Are you using the buttons without Bootstrap CSS?

I am not using the buttons without Bootstrap CSS , I want use default unstyled button element with Bootstrap CSS. But Bootstrap CSS change default button element behaviour.

One of the reasons Bootstrap uses classes like .btn instead of applying styles directly to the button element itself is to allow for flexibility and compatibility with various scenarios and customization needs.

By using classes to apply styles, Bootstrap maintains a separation between the structural HTML elements and the visual styling applied to them. This allows users to easily customize the appearance of elements while keeping the core HTML structure intact.

In scenarios where third-party libraries or content WYSIWYG editors are used within a Bootstrap layout, it's important to preserve the basic characteristics of HTML elements, including the focus outline. This ensures that the accessibility and usability of the elements are not compromised.

By following best practices and not overly modifying the essential characteristics of HTML elements, such as the focus outline, you can maintain compatibility with external components, improve accessibility, and make it easier to work with different tools and editors.

@vovochka-dev vovochka-dev changed the title Provide a general summary of the issue Invisible focus outline in chrome for button element Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants