mirror of https://github.com/vector-im/riot-web
Close copy tooltip in edge cases correctly
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/21833/head
parent
db73e641ea
commit
e2476acd0a
|
@ -114,7 +114,8 @@ export default class ShareDialog extends React.Component {
|
||||||
top: y,
|
top: y,
|
||||||
message: successful ? _t('Copied!') : _t('Failed to copy'),
|
message: successful ? _t('Copied!') : _t('Failed to copy'),
|
||||||
}, false);
|
}, false);
|
||||||
e.target.onmouseleave = close;
|
// Drop a reference to this close handler for componentWillUnmount
|
||||||
|
this.closeCopiedTooltip = e.target.onmouseleave = close;
|
||||||
}
|
}
|
||||||
|
|
||||||
onLinkSpecificEventCheckboxClick() {
|
onLinkSpecificEventCheckboxClick() {
|
||||||
|
@ -131,6 +132,12 @@ export default class ShareDialog extends React.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
// if the Copied tooltip is open then get rid of it, there are ways to close the modal which wouldn't close
|
||||||
|
// the tooltip otherwise, such as pressing Escape or clicking X really quickly
|
||||||
|
if (this.closeCopiedTooltip) this.closeCopiedTooltip();
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let title;
|
let title;
|
||||||
let matrixToUrl;
|
let matrixToUrl;
|
||||||
|
|
Loading…
Reference in New Issue