Skip to content

Commit ccb1818

Browse files
authored
Support for older versions of firefox
matches is not supported in older versions of firefox and currently this component only have a workaround implemented for old versions of internet explorer. I'm expanding that in order to support old versions of firefox as well.
1 parent 558ac6d commit ccb1818

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,15 @@ class ReactTooltip extends React.Component {
164164
const {show} = this.state
165165

166166
if (show && this.tooltipRef) {
167-
/* old IE work around */
167+
/* old IE or Firefox work around */
168168
if (!this.tooltipRef.matches) {
169-
this.tooltipRef.matches = this.tooltipRef.msMatchesSelector
169+
/* old IE work around */
170+
if(this.tooltipRef.msMatchesSelector) {
171+
this.tooltipRef.matches = this.tooltipRef.msMatchesSelector;
172+
} else {
173+
/* old Firefox work around */
174+
this.tooltipRef.matches = this.tooltipRef.mozMatchesSelector;
175+
}
170176
}
171177
return this.tooltipRef.matches(':hover')
172178
}

0 commit comments

Comments
 (0)