mirror of
https://github.com/videojs/video.js.git
synced 2025-01-29 11:23:10 +02:00
fix: disable title attribute on menu items (#4019)
Prevents a title attribute from being applied to MenuItems. MenuItem indicates to ClickableComponent that the control is not just an icon, so it shouldn't have a title attribute. Fixes #3699
This commit is contained in:
parent
29c6141de9
commit
04f23c1a62
@ -121,7 +121,10 @@ class ClickableComponent extends Component {
|
|||||||
|
|
||||||
this.controlText_ = text;
|
this.controlText_ = text;
|
||||||
this.controlTextEl_.innerHTML = localizedText;
|
this.controlTextEl_.innerHTML = localizedText;
|
||||||
el.setAttribute('title', localizedText);
|
if (!this.nonIconControl) {
|
||||||
|
// Set title attribute if only an icon is shown
|
||||||
|
el.setAttribute('title', localizedText);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -54,6 +54,9 @@ class MenuItem extends ClickableComponent {
|
|||||||
* The element that gets created.
|
* The element that gets created.
|
||||||
*/
|
*/
|
||||||
createEl(type, props, attrs) {
|
createEl(type, props, attrs) {
|
||||||
|
// The control is textual, not just an icon
|
||||||
|
this.nonIconControl = true;
|
||||||
|
|
||||||
return super.createEl('li', assign({
|
return super.createEl('li', assign({
|
||||||
className: 'vjs-menu-item',
|
className: 'vjs-menu-item',
|
||||||
innerHTML: this.localize(this.options_.label),
|
innerHTML: this.localize(this.options_.label),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user