-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Keyboard Accessible MenuItems and VolumeMenuButton #1519
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -717,7 +717,8 @@ easily in the skin designer. http://designer.videojs.com/ | |
} | ||
|
||
.vjs-default-skin .vjs-menu { | ||
display: none; | ||
z-index: -1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we could use the hide-visually mix-in here instead of z-index. There's potential that a menu button component could be used somewhere where the menu wouldn't be covered by the the player. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The .vjs-default-skin .vjs-menu selector is going back to using display: none based on your previous comment. So I don't it should be using hide-visually. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, it doesn't make sense to use it on .vjs-menu with the other change. I was mainly looking for an alternative to z-index for hiding it. Would height:0 or width: 0 work? That seems to basically be what youtube is doing. Alternatively we could add a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a little hesitant on the .visuallyhidden idea (although I experimented with it and does work alright). My first concern is that we also need to listen to hover in code rather than css. Secondly, I kinda like being able to use the lock/unlockShowing methods on menu, as opposed to manually adding/removing classes. The width: 0 works a bit better. It winds up being more css because you have to explicitly style the vjs-menu-content as well as the vjs-menu. However, I think this might be a better solution. I'm gonna try to clean my experiments up and push them up. |
||
display: block; | ||
position: absolute; | ||
bottom: 0; | ||
left: 0em; /* (Width of vjs-menu - width of button) / 2 */ | ||
|
@@ -732,6 +733,11 @@ easily in the skin designer. http://designer.videojs.com/ | |
border-top-color: rgba(7, 40, 50, 0.5); /* Same as ul background */ | ||
} | ||
|
||
.vjs-default-skin .vjs-control-content .vjs-menu { | ||
z-index: 0; | ||
display: none; | ||
} | ||
|
||
/* Button Pop-up Menu */ | ||
.vjs-default-skin .vjs-menu-button .vjs-menu .vjs-menu-content { | ||
display: block; | ||
|
@@ -748,7 +754,11 @@ easily in the skin designer. http://designer.videojs.com/ | |
.box-shadow(-0.2em -0.2em 0.3em rgba(255, 255, 255, 0.2)); | ||
} | ||
|
||
.vjs-default-skin .vjs-menu-button:hover .vjs-menu { | ||
.vjs-default-skin .vjs-menu-button:hover .vjs-menu, | ||
.vjs-default-skin .vjs-menu-button .vjs-menu.vjs-lock-showing { | ||
z-index: 1; | ||
} | ||
.vjs-default-skin .vjs-control-content .vjs-menu.vjs-lock-showing { | ||
display: block; | ||
} | ||
.vjs-default-skin .vjs-menu-button ul li { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,12 @@ vjs.VolumeMenuButton.prototype.createMenu = function(){ | |
contentElType: 'div' | ||
}); | ||
var vc = new vjs.VolumeBar(this.player_, vjs.obj.merge({'vertical': true}, this.options_.volumeBar)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gkatsev I'm realizing that the volume menu button is broken by default because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why would it be broken here? Seems to be working fine for us. It used to be broken when There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When I test this PR and try to drag the volume handle with my mouse, the bar is horizontal but the mouse movement needs to be vertical. Are you seeing something different? To be clear, I think this issue existed before this PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And by test I mean open /sandbox/index.html There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I see. There needs to be extra CSS that rotates it. |
||
vc.on('focus', function() { | ||
menu.lockShowing(); | ||
}); | ||
vc.on('blur', function() { | ||
menu.unlockShowing(); | ||
}); | ||
menu.addChild(vc); | ||
return menu; | ||
}; | ||
|
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.
Instead of making changes to the CSS for all menus is there a way we could use the
vjs-volume-menu-button
class and make updates only to that?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.
Yes, that seems better than what's there now.