Comments (6)
Got it. Moving to
<BsNav>
is not possible.I wonder if it is needed anymore at all. It seems to be used to set
active
anddisabled
CSS classes on<li class="nav-item">
.I cannot find having
active
ordisabled
CSS class on<li class="nav-item">
for Bootstrap 4 or 5 in Bootstrap's documentation. I can only find it in Bootstrap 3. In Bootstrap 4 and 5 theactive
anddisabled
CSS classes are on the<a>
element, which is rendered by<BsLinkTo>
itself.Unless I missed something the code seems to be a leftover from Bootstrap 3 support, which we missed to remove. Would be great if you could double check as well.
Assuming I haven't missed something, I would recommend doing 2 PRs:
- Removing
active
anddisabled
CSS classes from<li class="nav-item">
and all code related to it.- Refactoring
<BsNav::Item>
to Glimmer component, which should be unblocked after we landed the cleanup in first step.I prefer two PRs to highlight the markup change more prominently in changelog. I don't think it's a breaking change. I would consider that HTML private implementation detail and not matching markup from Bootstrap docs as a bug. But clearly documenting the change might be good anyways.
Yup, after investigating, I also can only see evidence of it being used for BS3 support. I've created a PR to remove the binding between the two
from ember-bootstrap.
For the BsNav::Item
and BsLinkTo
I ran into an issue with the way parent/child lookups are being done.
In most of the new code, we pass through registerChild/unregisterChild
functions from the parent to the child.
The old code relies on Ember for finding the nearest component of a type using the nearestOfType
function.
Due to the way Bs::Nav yields children, it is not possible to have it exactly the same way in glimmer. Namely, the following situation will cause issues:
We have no way of telling the nav.link-to
that it should register itself as a child of nav.item
.
What should we do in this situation?
from ember-bootstrap.
Thanks a lot for investigating.
I think the root cause is that the <BsLinkTo>
component is yielded from <BsNav>
. But it should be yielded from <BsNav::Item>
as it is expected to be used as a child of that one.
Changing which component yields <BsLinkTo>
would be a breaking change. And would require touching all usages of it in all consuming apps. I would like to prevent that for now.
Would it be possible to register the <BsLinkTo>
instances in <BsNav>
and pass them as an argument to <BsNav::Item>
for now?
from ember-bootstrap.
I'm not sure if that is possible. If we have the <BsNav>
register all link-to
components, how would we tell which link is inside which <BsNav::Item>
.
Considering the following situation:
What could we do from the yield in BsNav
to identify which item contains what link?
from ember-bootstrap.
Got it. Moving to <BsNav>
is not possible.
I wonder if it is needed anymore at all. It seems to be used to set active
and disabled
CSS classes on <li class="nav-item">
.
I cannot find having active
or disabled
CSS class on <li class="nav-item">
for Bootstrap 4 or 5 in Bootstrap's documentation. I can only find it in Bootstrap 3. In Bootstrap 4 and 5 the active
and disabled
CSS classes are on the <a>
element, which is rendered by <BsLinkTo>
itself.
Unless I missed something the code seems to be a leftover from Bootstrap 3 support, which we missed to remove. Would be great if you could double check as well.
Assuming I haven't missed something, I would recommend doing 2 PRs:
- Removing
active
anddisabled
CSS classes from<li class="nav-item">
and all code related to it. - Refactoring
<BsNav::Item>
to Glimmer component, which should be unblocked after we landed the cleanup in first step.
I prefer two PRs to highlight the markup change more prominently in changelog. I don't think it's a breaking change. I would consider that HTML private implementation detail and not matching markup from Bootstrap docs as a bug. But clearly documenting the change might be good anyways.
from ember-bootstrap.
Thanks a lot to @SanderKnauff for implementing the @glimmer/component
refactoring.
from ember-bootstrap.
Related Issues (20)
- Refactor away from observers HOT 1
- Remove BrowserStack badge
- Run tests on Safari again HOT 2
- Remove subclassing deprecation message
- Drop RSVP dependency
- Road to TypeScript HOT 16
- Review need of custom CSS HOT 2
- Deprecate Bootstrap CSS, fonts, and theme import
- Deprecate inserting wormhole target HOT 1
- Improve public API for <BsDropdown>
- Bootstrap 5 dropdown direction and menu alignment HOT 5
- BsCarousel indicators are missing `aria-label` attribute.
- BsCarousel customizable controls are not working HOT 1
- Tracking issue: ember-bootstrap 7.0.0
- Deprecate ember-bootstrap blueprints HOT 2
- [6.1.0] {{on 'click'}}, <LinkTo> and <menu.linkTo> in dropdown menus dysfunctional HOT 8
- Test app does not rebuild when doing changes to the library HOT 2
- TypeScript files are published and not transpiled to JavaScript before HOT 5
- Tooltips are positioned too close to triggering element HOT 10
- Support responsive alignment for dropdown menu
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-bootstrap.