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 {
|
||||
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) {
|
||||
super(props);
|
||||
|
||||
@ -40,12 +48,11 @@ class Tooltip extends Component {
|
||||
delay: this.delay,
|
||||
onShow: this.onShow,
|
||||
onHide: this.onHide,
|
||||
wait: Tooltip.wait,
|
||||
touchHold: true,
|
||||
};
|
||||
|
||||
this.tooltip = Tippy(`#${this.tippySelectorId}`, options);
|
||||
}
|
||||
|
||||
onShow() {
|
||||
document.addEventListener('keyup', this.handleEscapeHide);
|
||||
}
|
||||
@ -56,7 +63,6 @@ class Tooltip extends Component {
|
||||
|
||||
handleEscapeHide(e) {
|
||||
if (e.keyCode !== ESCAPE) return;
|
||||
|
||||
this.tooltip.tooltips[0].hide();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user