Comments (15)
How about making this variable as combination type such as ("sequential, spatial" | "spatial"), or {sequential, spatial}?
I don't understand. This would be a media feature, not a variable, so you could write:
@media (navigation: spatial) { ... }
@media (navigation: sequential) { ... }
@media (navigation) { /*matches if either is true*/ }
@media (navigation: none ) { /*matches if both are false*/ }
@media not (navigation) { /*same as above*/ }
Given how media queries work, the first two could absolutely match on the same device, if that device supports both sequential and spatial.
I also imagine an extended navigation, let's say that 3d navigation
Sure, no problem, then we can just add the new value, and you can continue to write the same as above, and also @media (navigation: nav3d) { ... }
, and then @media (navigation) { ... }
matches if any type of navigation, including 3d, is available.
from spatial-navigation.
Devices without a keyboard, and therefore no tab key (unless they provide some other way of triggering it).
Got it! I like @frivoal's idea. Could we suggest this proposal at the CSS wg f2f meeting?
Unlike limits of a media type that can handle a condition according to sort of output devices, this proposal that can distinguish input devices would have few issues on discriminating between the devices.
I'll put some concerns on this after the first formal proposal summary. Gathering use cases would be important in addition to the spatial navigation for now.
from spatial-navigation.
Yes, I discussed with Jihye today, and we will propose it at the CSSWG F2F. I will write a more detailed proposal in the csswg's repo and link it from here.
from spatial-navigation.
@Malvoz @supports
allows to check if certain CSS property/value pairs are supported. This spec is mostly not about CSS properties (although it does propose one: spatial-navigation-contain
). Knowing that this property is not supported wouldn't tell you anything about whether the browser implements the processing model, or about whether the user is able to trigger spatnav.
from spatial-navigation.
Suggesting the feature to the CSSWG: w3c/csswg-drafts#2494
from spatial-navigation.
I think we should probably have a media query, which lets the author ask about the presence of spatnav, and probably also about tab-based navigation.
Maybe something like this: navigation: sequential | spatial | none
, so that you can write
@media (navigation: spatial) {...}
in CSS or
if window.matchMedia("(navigation: spatial)").matches) { ... }
in JS
from spatial-navigation.
Basically, we can use preventDefault()
in a keydown event handler when author want to cancel the default spatnav, but I think @junhoseo's proposed API could be used for several purposes. The media query approach seems interesting to me.
Does the media query means there is a navigation
CSS property that I can also use to set the spatnav mode? Otherwise, dose it mean to be used only in the media query scope?
from spatial-navigation.
Does the media query means there is a navigation CSS property that I can also use to set the spatnav mode? Otherwise, dose it mean to be used only in the media query scope?
Media queries and properties are independent.
from spatial-navigation.
Maybe something like this: navigation: sequential | spatial | none, so that you can write
How about making this variable as combination type such as ("sequential, spatial" | "spatial"), or {sequential, spatial}?
I imagine that only spatial navigation allowed user agent. I also imagine an extended navigation, let's say that 3d navigation. In this case, it will be better if we enumerate all supported navigation type than having single value.
from spatial-navigation.
Media queries and properties are independent.
Do you mean navigation
is used as a media feature only in Media queries? I'm not yet sure how we can use the navigation
as the media feature. What situations @media (navigation: sequential)
condition is false in?
from spatial-navigation.
How about making this variable as combination type such as ("sequential, spatial" | "spatial"), or {sequential, spatial}?
Oh, your idea already implies my comment. Thanks! :)
from spatial-navigation.
What situations
@media (navigation: sequential)
condition is false in?
Devices without a keyboard, and therefore no tab key (unless they provide some other way of triggering it).
from spatial-navigation.
... But, How to know a browser supports spatnav ...
+ @frivoal
I'm not sure I'm missing something here, but wouldn't @supports
be applicable?
from spatial-navigation.
How about considering this by defining the new interface?
Such as, "SpatialNavigator
" interface.
The SpatialNavigator
interface of the spatial navigation which manages the process of spatial focus navigation on the web page.
Be specific,
-
Constructor
- SpatialNavigator(): Creates a new SpatialNavigator object.
-
Event Handlers
- SpatialNavigator.navbeforefocus: Dispatched when the spatial navigation process finds the best candidate.
- SpatialNavigator.navbeforescroll: Dispatched when the spatial navigation triggers scrolling.
- SpatialNavigator.navnotarget: Dispatched when the spatial navigation fails for finding the best candidate.
On top of that, the APIs in the current spatial navigation spec can be combined with this.
In this sense, the developer can know whether the page supports spatial navigation or not.
For example,
if (window.SpatialNavigator) {
// The spatial navigator is supported
} else {
// The spatial navigator is not supported
}
Also, the developer creates a SpatialNavigator
to build a web page which uses the spatial navigation APIs.
from spatial-navigation.
Issue migrated to w3c/csswg-drafts#3385
from spatial-navigation.
Related Issues (20)
- More precise `isVisibleStyleProperty` function
- Using Spatial Navigation Action API
- How to handle Popup focus navigation HOT 1
- Spatial Navigation Containers HOT 2
- navigateChain in polyfill does not seem to always use supplied focusable option parameter
- Arrow keys always move scrollbar HOT 1
- focus suddenly moves out of the scroll container
- Focus looping when the focused elements are overlapped with their borders
- Sometimes focus cannot move out of the iframe for left/right navigation direction
- Remove 'inside' option from spatialNavigationSearch
- Can this be used with canvas/webgl/pixi.js? HOT 5
- Browser Support seems to be wrong HOT 5
- Consideration of keyup event for Polyfill instead of keydown HOT 1
- spatial navigation polyfill does not move the focus to the adjacent element: HOT 1
- shadow dom (open) support HOT 8
- spatial navigation polyfill does not check the state of unrelated modifier keys like Ctrl/Meta/Alt... HOT 2
- How would screen reader users use spatial navigation? HOT 3
- Can not access the demo page HOT 1
- container.getSpatialNavigationContainer is not a function HOT 2
- Performance Issues - Layout Thrashing
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 spatial-navigation.