-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
addresses #7652: deep linking for tabs and browser history update #9242
Conversation
Awesome! We're in the middle of QA for 6.2.4 so it will be a bit before we can test this out but this will be great for 6.3. |
OK, now tested in practice and fixed a little--should be working with the default options as I have them and
to turn on deep linking. |
I like this... @Owlbertz @colin-marshall @coreysyms I'm thinking this approach could form the foundation of deep linking across various other components as well (tabs, accordion). What do you think? |
Sounds like a good idea in general for me. Not sure if this is already in place, but other components I think of are Magellan and maybe even Orbit and Reveal. (I am a huge fan of being able to send links that reflect exactly the state of the website that I am currently seeing.) |
@kball @Owlbertz @colin-marshall I like this PR however I have some notes / changes:
Open for thoughts and discussion. |
Before I forget to suggest code for "smudging" here is a snippet that could work as a jump off point. When the address bar hits
|
sorry wrong button, reopened |
I won't claim there isn't one, but I can't think of a way to safely bring the tab titles into the viewport without calculating the offset after page load. Positioning the I'm not hung up on this smudge/offset behavior since it's easy to do outside the framework, but we almost always use it to make the tab titles visible. I'm good with the other suggestion:
|
Given the variability of styles on tabs I don't know a great way to default it into view... here would be my suggestion:
I also do think the updateHistory option is a must. @coreysyms @ahebrank what do you think? |
@kball This will work for me.
Thanks for this PR, after these changes come in, we should push it to 6.3 |
Points from @coreysyms should now be addressed. Also added some documentation and a deeplink event as suggested by @kball. |
@kball this looks good to me, take a look when you get a sec. |
Sweeeeet! Great work @ahebrank |
Is there also the API call back, for example: current tab is #4 ? |
@jaysonbrown there are events triggered on deeplink ( |
@kball Thanks for the reply, that's perfect! |
@kball |
@RLaptev, that was dumb on my part. Does this fix it?
|
@ahebrank |
@ahebrank would you like to submit a PR with this fix? |
This article really helped me: http://codepen.io/rogerpence/post/programming-foundation-6-s-tab-component |
First attempt to include workaround from #7652 (comment)
This is currently totally untested and I haven't even added it into an existing project to see if it works at all.
Adds 4 new options to tabs: