Skip to content
Snippets Groups Projects
Commit 1127cef3 authored by Karishma Chadha's avatar Karishma Chadha
Browse files

Since the mainTooltpId is now being used as part of the action menu items,...

Since the mainTooltpId is now being used as part of the action menu items, make sure it is generated in the constructor of the action menu component instead of within the render method. This fixes a regression caused by a recent change where the file upload buttons in the action menu stopped working.
parent 9994f688
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,7 @@ class ActionMenu extends React.Component {
isOpen: false,
forceHide: false
};
this.mainTooltipId = `tooltip-${Math.random()}`;
}
componentDidMount () {
// Touch start on the main button is caught to trigger open and not click
......@@ -105,8 +106,6 @@ class ActionMenu extends React.Component {
onClick
} = this.props;
const mainTooltipId = `tooltip-${Math.random()}`;
return (
<div
className={classNames(styles.menuContainer, className, {
......@@ -120,7 +119,7 @@ class ActionMenu extends React.Component {
<button
aria-label={mainTitle}
className={classNames(styles.button, styles.mainButton)}
data-for={mainTooltipId}
data-for={this.mainTooltipId}
data-tip={mainTitle}
ref={this.setButtonRef}
onClick={this.clickDelayer(onClick)}
......@@ -134,7 +133,7 @@ class ActionMenu extends React.Component {
<ReactTooltip
className={styles.tooltip}
effect="solid"
id={mainTooltipId}
id={this.mainTooltipId}
place={tooltipPlace || 'left'}
/>
<div className={styles.moreButtonsOuter}>
......@@ -143,7 +142,7 @@ class ActionMenu extends React.Component {
fileAccept, fileChange, fileInput}, keyId) => {
const isComingSoon = !handleClick;
const hasFileInput = fileInput;
const tooltipId = `${mainTooltipId}-${title}`;
const tooltipId = `${this.mainTooltipId}-${title}`;
return (
<div key={`${tooltipId}-${keyId}`}>
<button
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment