Skip to content

use only data target to query elements in our plugin #31185

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Johann-S
Copy link
Member

@Johann-S Johann-S commented Jun 26, 2020

With this PR we'll rely only on data-target to find targeted elements. The only exception is our Scrollspy which use a lot of link, it'll still be possible to use selectors in links for this plugin.

Related to: #31160

Preview: https://deploy-preview-31185--twbs-bootstrap.netlify.app/

@patrickhlauke
Copy link
Member

this made me remember a bugbear that i kept meaning to post #31186

@Johann-S
Copy link
Member Author

@patrickhlauke I think it'll fix your issue too 🤔

@patrickhlauke
Copy link
Member

@patrickhlauke I think it'll fix your issue too 🤔

yeah i meant it more as "once this lands, we should also do this" and then avoid unnecessarily using <a href="#" data-target="..." role="button"> when a real button is the preferred/logical/semantic choice. while mentioning that links can be used, we should set a good example of using the more correct element as trigger for in-page actions

@XhmikosR
Copy link
Member

The "problem" with swapping a tags with buttons is that it requires CSS changes in our components, but that's for another place to discuss.

Do note that we should probably try to keep the breaking changes to a minimum to make things easier for people to upgrade. Or perhaps, we should make them all at once :P

I'd definitely like to hear @mdo's opinion before proceeding with this. Have a href="#" all over the place does not seem good either, but if it's an intermediate solution I guess we could live with it for a while.

@patrickhlauke
Copy link
Member

The "problem" with swapping a tags with buttons is that it requires CSS changes in our components, but that's for another place to discuss.

yup, certainly for carousel, possibly other places like tabs (navs with js). let's discuss in #31186

Do note that we should probably try to keep the breaking changes to a minimum to make things easier for people to upgrade. Or perhaps, we should make them all at once :P

Was trying to get some of these breaking ones in while 5 is still in alpha...otherwise it'll be another 2-3 years before we can change anything again ;)

@XhmikosR
Copy link
Member

Was trying to get some of these breaking ones in while 5 is still in alpha...otherwise it'll be another 2-3 years before we can change anything again ;)

That's not true since we have moved to a faster release cycle. :)

@mdo
Copy link
Member

mdo commented Sep 10, 2020

Any status update here?

@Johann-S
Copy link
Member Author

@mdo it seems we are waiting for your decision

@GeoSot GeoSot added v6 and removed v5 labels Apr 28, 2021
@septatrix
Copy link
Contributor

Wouldn't this be a degradation for JS-less users?

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

Successfully merging this pull request may close these issues.

7 participants