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
Sufficient Technique C43 is not a sufficient technique #3187
Comments
Hi James, We'll take another look at the technique, thanks for posting this. It might be a case of qualifying the current technique, e.g. to be careful of wrapping text. If you'd like to boil your approach down to a technique, we'd happily take a PR, or we could create one based on your approach if that's ok? Given that the SC is focused on navigating interactive elements, I don't think that the lack of support when caret browsing is a problem. |
I'm quite happy for you to use what I've done as it suits.
Why not? Caret browsing still reaches interactive elements, isn't that something a user who needs it would have turned on all the time? |
@brothercake We (well, mostly @adampage) took your example and adapted it to what's there for C43 at the moment. Can you take a look at this codepen and see if you have any feedback. Thanks. |
This update addresses issue 3187 1. Adds support for dialog element of unknown height. 2. Adds support for caret browsing. 3. Retitled C43 and working example as they now use `scroll-padding` instead of `margin-padding`. 4. Updated Resources links Closes #3187 Signed-off-by: Francis Storr <francis.storr@intel.com>
@fstrr @adampage This looks great, works perfectly. The only potential gap in its functionality is where viewport resizing happens on the fly (e.g. when an element is already focused, and resizing the window causes it to disappear behind the dialog), this doesn't trigger an immediate update, not until the focus moves to another element. But I'm not sure that's really necessary anyway. |
Thank you, @brothercake. Oof, that’s a good point. It’d be handy if the browser had some sort of I suppose we could detect which element is currently focused, do some math, and then set |
@adampage Yeah I did this by evaluating boundary overlap in cases where the ResizeObserver fires, and an element is already focused, and that element is not inside the header, then calling
But the scenario is not particularly common, and most likely to only happen when a layout is being tested for reflow, rather than a user doing this. Even then, it's only a temporary situation that wouldn't fail 2.4.7 or 2.4.11, so I don't think it's essential. |
This technique doesn't work properly, in that:
A sufficient technique would use scroll-padding and would re-calculate it dynamically using a resize observer.
See the following for notes I made about this approach, based on Alastair's original proof of concept: https://www.tpgi.com/prevent-focused-elements-from-being-obscured-by-sticky-headers/#an-alternative-approach
The text was updated successfully, but these errors were encountered: