-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Service for handling keyboard vs. mouse focus behavior #289
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
Comments
@devversion yeah, this would be nice to have. I think the better solution is to set a flag on |
@jelbourn - This is what we currently do in Material 1 and Material 2. scope.mouseActive = false;
element.on('mousedown', function() {
scope.mouseActive = true;
$timeout(function(){
scope.mouseActive = false;
}, 100);
})
.on('focus', function() {
if (scope.mouseActive === false) {
element.addClass('md-focused');
}
})
.on('blur', function(ev) {
element.removeClass('md-focused');
}); But this is an old approach and is not working probably anymore. I also created an issue on Material 1 a few days ago. Please take a look at it and the accompanying PR.
This service tracks the last interaction type and allows us to provide perfect accessibility on some components. |
Having a service would be good. Feel free to put together a PR! |
@jelbourn Awesome, will start that tomorrow 👍 |
Just want to reference a few things here. The focus is currently accidentally showing up on Desktop Browsers, because the current workaround with the timeout is not working properly. Once the Interaction Service will be approved / land, we will fix the following components:
cc. @jelbourn |
Hi, It looks that the radio focus indicator is still broken or not there. Where can i take a look on this how to fix it or add this feature? thanks |
This should be fixed with the new |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Currently, we always show a focus effect on the button component, when there was no mouse event the last
100ms
.This is really hard-coded and there are bugs. For example, switching browser tabs, is restoring focus and showing the focus-effect (should not happen).
A service for interaction, which detects the last interaction type would solve that issue very elegant and would be also helpful for other components.
I also implemented that in Material 1 (still pending after re-submit) and I would like to implement it in Material 2 as well.
So let me know if you need this, and I will implement it :)
The text was updated successfully, but these errors were encountered: