Comments (6)
This should already be possible https://github.com/microsoft/keyborg/blob/bdfc82f67b743c64e8d9ec0bfac50b75d72e9cef/src/FocusEvent.ts#L252-L259
from tabster.
@ling1726 I know that you can check if something was programmatically focused or not, but I don't think you can check whether tabster was the cause of the focus moving programmatically or if something else was the cause, can you?
from tabster.
Ah @khmakoto I see what you mean. Can you please describe the scenario where this would be needed?
from tabster.
It's for scenarios like the one in Tooltip
here, where we do not want a tooltip to show if things like closing another surface would cause focus to be restored to a trigger button with a Tooltip
attached to it. However, there are products that have a mixture of tabster
usage + their own custom solutions for certain focus related scenarios where they sometimes move focus programmatically and would like the Tooltip
to show up in those scenarios. which is impossible now because there is no way to differentiate between those.
from tabster.
Tabster dispatches tabster:movefocus
event every time before it moves focus. See TabsterMoveFocusEventDetail
for the event's detail signature (it has next element and related keyboard event, if any). You can also can call preventDefault() and Tabster won't handle it at all (but you will have all the data about what it wanted to focus).
from tabster.
Tabster also adds typings for addEventListener()
so that you don't need to import the event signature directly, it will be inferred automatically when you do document.addEventListener('tabster:movefocus', e => ...)
.
from tabster.
Related Issues (20)
- Add possibility to register custom callback when key events occur in tabster
- Best Practices for Testing Focus Behavior
- Shadow DOM: Update MutationObserver to work with shadow roots
- Shadow DOM: support `activeElement` in shadow roots
- Shadow DOM: implement `Node.contains()` function to support shadow roots and slots
- Shadow DOM: implement `TreeWalker` that can walk shadow roots
- Shadow DOM: implement a "getParent()" function to correctly walk up the DOM tree for elements in the shadow root
- Implement Shadow DOM support HOT 1
- Tabster ignores focusable elements possibly because they are in Shadow DOM
- Tabster should move focus to the selected `radio` item in a group
- Support resetting memorizeCurrent for instances like new chat messages
- Focusable does not handle the inert attribute
- Tabster doesn't handle native audio and video elements
- `getCurrentTabster` is not exported
- Restorer steals focus from non-modal modals when trigger is inside of arrow navigation group HOT 2
- Code can not display in story book HOT 2
- Tabster crashes in Firefox HOT 1
- Optimize bundle size HOT 2
- [Mover] Keyboard arrow navigation doesn't work for RTL grid layout HOT 1
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 tabster.