-
Notifications
You must be signed in to change notification settings - Fork 712
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
Handle keyboard-dependent focus outlines in Vuex #4847
Handle keyboard-dependent focus outlines in Vuex #4847
Conversation
}, 100); | ||
}, | ||
true | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this was probably just copied over during the port so fine to leave as-is. However heads-up that we have two throttling libraries already included:
- https://github.com/pelotoncycle/frame-throttle for high FPS stuff
- lodash throttle for other stuff
console.error("Couldn't find any matchesSelector method on document.body."); | ||
})(); | ||
|
||
const disableFocusRingByDefault = function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this function here? Presumably the Keen-UI helper is still doing this part?
'focus', | ||
e => { | ||
if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) { | ||
kolibriGlobal.coreVue.vuex.store.commit('SET_MODALITY', 'keyboard'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason we can't just import the store here, rather than referencing the global?
Should be able to do: import store from 'kolibri.coreVue.vuex.store';
and then just reference that, no?
document.body.addEventListener( | ||
'blur', | ||
() => { | ||
kolibriGlobal.coreVue.vuex.store.commit('SET_MODALITY', null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can do a little bit of cleanup in the vendored code, but looks like the right fix!
tested and it seems to work well note there are broken snapshot tests |
Codecov Report
@@ Coverage Diff @@
## develop #4847 +/- ##
===========================================
+ Coverage 74.96% 75.11% +0.15%
===========================================
Files 261 261
Lines 12282 12282
Branches 1484 1484
===========================================
+ Hits 9207 9226 +19
+ Misses 2744 2732 -12
+ Partials 331 324 -7
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## develop #4847 +/- ##
===========================================
- Coverage 74.96% 51.2% -23.76%
===========================================
Files 261 864 +603
Lines 12282 26668 +14386
Branches 1484 3552 +2068
===========================================
+ Hits 9207 13656 +4449
- Misses 2744 12268 +9524
- Partials 331 744 +413
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging in - created follow up issue at #4859
Summary
core.modality
property in vuexcore.modality
Reviewer guidance
References
Fixes #4822
Contributor Checklist
PR process:
Testing:
Reviewer Checklist
yarn
andpip
)