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

.visually-hidden class conflicts with bootstrap 5 #517

Open
elgordino opened this issue Aug 11, 2023 · 0 comments
Open

.visually-hidden class conflicts with bootstrap 5 #517

elgordino opened this issue Aug 11, 2023 · 0 comments

Comments

@elgordino
Copy link

Describe the bug
Both bootstrap 5 and ember-sortable use a .visually-hidden class. This results in styles being applied to an ember-sortable element that can cause layout issues. Particularly because the bootstrap class makes the element absolutely positioned.

To Reproduce
Add ember-bootstrap and ember-sortable to a project. Configure ember-bootstrap to use boostrap 5 and add a sortable-group

This span is added by ember-sortable

<span aria-live="polite" class="visually-hidden"></span>

Styles for .visually-hidden on the span element are (these all come from bootstrap)

.visually-hidden:not(caption), .visually-hidden-focusable:not(:focus):not(:focus-within):not(caption) {
    position: absolute !important;
}

.visually-hidden, .visually-hidden-focusable:not(:focus):not(:focus-within) {
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

Expected behavior
The span does not have additional styles applied from bootstrap

Proposal

I've worked around this in my project by applying more specific styles, however it took me quite some time to track down what was causing a weird behavior in my application so I thought it would help others if this style could be updated to avoid the issue.

I propose renaming .visually-hidden to .ember-sortable-visually-hidden, The class name does not appear to form any part of an external interface so I think it would be a non-breaking change?

Happy to raise a PR for this if the proposal sounds good?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants