Skip to content

Commit

Permalink
Merge pull request #204 from SizeMeCom/fix-meas-input-tooltip-visibility
Browse files Browse the repository at this point in the history
Different timeout method for measurement input tooltip show
  • Loading branch information
nomasi authored Nov 8, 2021
2 parents 09701cc + a444eda commit 7e5069f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/common/MeasurementInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ class MeasurementInput extends React.Component {
clearTimeout(this.timeout);
this.timeout = null;
}
if (this.tooltipTimeout) {
clearTimeout(this.tooltipTimeout);
this.tooltipTimeout = null;
}

// because isBlur could be an event
const blur = isBlur === true;
Expand Down Expand Up @@ -111,7 +115,7 @@ class MeasurementInput extends React.Component {

onFocus = () => {
this.props.onFocus();
ReactTooltip.show(this.tooltip);
this.tooltipTimeout = setTimeout(() => {ReactTooltip.show(this.tooltip);}, 200);
};

onKeyDown = e => {
Expand Down
2 changes: 1 addition & 1 deletion src/common/SizeForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class SizeForm extends React.Component {
).orElse(null)}
</div>
))}
<ReactTooltip id="input-tooltip" type="light" resizeHide={false} delayShow={200} getContent={this.tooltipContent(t)}/>
<ReactTooltip id="input-tooltip" type="light" resizeHide={false} getContent={this.tooltipContent(t)}/>
<Modal isOpen={this.state.guideModalOpen}
onRequestClose={this.closeGuideModal}
className="measurement-guide-modal"
Expand Down
4 changes: 4 additions & 0 deletions src/common/SizeForm.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@
pointer-events: all;
margin-left: 15px;

&.place-top {
margin-top: -40px;
}

ul {
background-color: $bg_color;
color: black;
Expand Down

0 comments on commit 7e5069f

Please sign in to comment.