-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
"Tab" key = bug #1237
Comments
Yeah right. The only solution is not simple... Depending on the browser some elements are able to receive the focus on In order to prevent it, fullPage.js would have to set The other option is just to disable the tab in fullPage.js. Or you manually setting tabindex to |
A quick fix we implemented was this... $('a, input, select').prop('tabIndex', -1); This basically does what alarotrigo said and disables tabbing globally on the page... We actually just got a complaint from a client saying that they couldn't tab through this one form so you might be getting a pull request if I can find a decent solution, but as you said it might affect performance if there are a ton of elements... |
You can also set the wrapper of those elements to #section3 #myForm{
display:none;
}
#section3.active #myForm{
display: block;
} |
I'll keep looking into this issue. |
I just did a test with the following. $('.fp-section').not('.active').css('opacity', 0); and I can still tab to the opaque elements, you might need to use display: none... |
True. |
Seems to work pretty well doing the following.. // On load
$('.fp-section').not('.active').hide();
// On transition - To next slide
$('.fp-section.active').next().show(); Just need to make sure that it hides the previous after the animation is finished, and if you want to jump to a specific index you can't use .next obviously.. but as a proof of concept it seems to be functional. |
It seems the |
@criten your solution might carry some problems. It would need to be tested. But hiding the section completely on load (before even calling fullPage.js) might make things such as |
In your case I would go for the CSS solution I provided. |
Hello, sorry for the response time. A nice feature is that the page scroll directly to the fields selected by the "tab" key. |
What's the best solution for this? |
There's not? The topic still open. |
It working for me:
|
@pawelszewczak, Thanks for the fix but rather than saying it's a fix, it's a worker-round to disabling tab-index so fullpage will not break. |
Which is far from ideal within a form. |
@warapitiya i didn't say that is fix, i said its working for me, of course its a some of workaround, but helps to dont breake fullpage. Of course, I look forward to a solution. |
@pawelszewczak Thanks alot. Really appropriate your hard work. Looking foreword so solid solution. |
Hi @alvarotrigo Just to make sure - if i want to use fullPage.js section that contain a Form and my users need a Keyboard Accessibility support to navigate from section to section -> this is not an option ? also i added the scrollBar:true and still using the tab still got this issue |
@eladh as I said, I would recommend you to use Browsers act weird when focusing elements within a non scrollable site. |
Hi everyone, I recently found a solution that I will share: First, I cancel the navigation with the tab key (and create my variable):
And I only activate the necessary fields when I arrive on the desired slide:
Voilà ! |
the plugin must work with tab navigation, it's really a problem because our sites must be accessible (level AA) and navigate with tabs is the minimum requirement. It's an obligation in my sector (e-government sites). And I think it will be an legal obligation in 2 years in europe for all sites. |
@sede1971 suggestions for the solution will be more than welcome :) |
I have bought 2 extensions these 2 days, I will spend some times to see if I can have some results with tabs |
My fix for this: .section { visibility: hidden; } .section.js--section-visible { visibility: visible; } var $leavedSection = null, makeSectionVisibleOrHidden = function($section) { $section.toggleClass('js--section-visible'); }; //the first section on the page should have by default 'js--section-visible' class $elem.fullpage({ onLeave: function(index, nextIndex, direction) { var $leavingSection = $(this); $leavedSection = $leavingSection; //make next section we are scrolling to visible just before animating if (direction == 'down') { makeSectionVisibleOrHidden($leavingSection.next()); } else if (direction == 'up') { makeSectionVisibleOrHidden($leavingSection.prev()); } }, afterLoad: function(anchorLink, index) { var loadedSection = $(this); //hide leaved section after animation ended if ($leavedSection) makeSectionVisibleOrHidden($leavedSection); } }); |
@infloent thanks for your contribution! Although your solution won't work for pages using But... I've been taking another look at it and it seems finally I've found a proper solution!! (function(){
// taken from https://github.com/udacity/ud891/blob/gh-pages/lesson2-focus/07-modals-and-keyboard-traps/solution/modal.js
// suggested here:
//https://developers.google.com/web/fundamentals/accessibility/focus/using-tabindex
var focusableElementsString = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable]';
$(document).on('focusin', focusableElementsString, checkFocus);
function checkFocus(){
if (!$(this).closest('.fp-section.active').length) {
$('.fp-section.active').focus();
}
}
})(); onLeave: function(index, nextIndex, direction){
$('.fp-section').eq(nextIndex - 1)
.attr('tabindex', 0)
.siblings().removeAttr('tabindex');
},
afterLoad: function(){
$('.fp-section.active').attr('tabindex', 0);
} Basically I'm adding a |
Ok, that solution only worked well for sections, not for slides. The focus of the slide won't get the right position of it and will only show the last bit of it. I figured out other way. |
Fixed on the dev branch 2.9.6! Will get merged in the next release. |
Updating did not help in my case. Using tab in fullpage section still focused next or previous section / link. I used What worked for me:
which was fine in my use case since I do not use keyboard scrolling (Tab). |
In case of a bootstrap 3 modal which has a form in it, the tabbing on the form doesn't work. You cannot Tab from one input to another. it checks if the 'action' happen in the fullPage block or outside of it (like in the case of a bootstrap modal) |
Disabling tabbing globally is definitely not a solution. It prevents tabbing between input fields in login/signup forms. Current 2.9.6 version is not dist ready. |
UPDATE: This worked for us:
We're running into this issue. We have a form in a div overlay, but not able to tab through the inputs. Any suggestions on how to attack?
Thanks in advance! |
@lkorsun that's a partial solution, shift+tab does not work and I still can't tab to the submit button. |
Hello ! focusableElementsString = 'a[href], area[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable]'; |
That was solved on the dev branch yesterday. You can try it out. You can see the committed changes here. |
Thanks! I will try |
Hello,
I discovered a bug.
If the website contains a link or a form when you press the "tab" key, the browser goes directly to the section concerned but the navigation is completely broken.
The text was updated successfully, but these errors were encountered: