Add rule for don't show tooltip when dropdown is open. Closes #5194
This commit is contained in:
parent
b618f7035b
commit
bef61eeeda
12
bigbluebutton-html5/imports/ui/components/tooltip/component.jsx
Normal file → Executable file
12
bigbluebutton-html5/imports/ui/components/tooltip/component.jsx
Normal file → Executable file
@ -18,6 +18,14 @@ const defaultProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class Tooltip extends Component {
|
class Tooltip extends Component {
|
||||||
|
static wait(show, event) {
|
||||||
|
const tooltipTarget = event.target;
|
||||||
|
const expandedEl = tooltipTarget.parentElement.querySelector('[aria-expanded="true"]');
|
||||||
|
const isTarget = expandedEl === tooltipTarget;
|
||||||
|
if (expandedEl && !isTarget) return;
|
||||||
|
show();
|
||||||
|
}
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
@ -40,12 +48,11 @@ class Tooltip extends Component {
|
|||||||
delay: this.delay,
|
delay: this.delay,
|
||||||
onShow: this.onShow,
|
onShow: this.onShow,
|
||||||
onHide: this.onHide,
|
onHide: this.onHide,
|
||||||
|
wait: Tooltip.wait,
|
||||||
touchHold: true,
|
touchHold: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
this.tooltip = Tippy(`#${this.tippySelectorId}`, options);
|
this.tooltip = Tippy(`#${this.tippySelectorId}`, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
onShow() {
|
onShow() {
|
||||||
document.addEventListener('keyup', this.handleEscapeHide);
|
document.addEventListener('keyup', this.handleEscapeHide);
|
||||||
}
|
}
|
||||||
@ -56,7 +63,6 @@ class Tooltip extends Component {
|
|||||||
|
|
||||||
handleEscapeHide(e) {
|
handleEscapeHide(e) {
|
||||||
if (e.keyCode !== ESCAPE) return;
|
if (e.keyCode !== ESCAPE) return;
|
||||||
|
|
||||||
this.tooltip.tooltips[0].hide();
|
this.tooltip.tooltips[0].hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user