react-tippy
react-tippy copied to clipboard
Fix issues related to title and html props
Description
I noticed that react-tippy
wasn't working on IE11. I was getting this error message:
[getPopperElement]: Element passed as the argument does not exist in the instance
Digging in, I discovered that this line seemed partly responsible: if the title
prop is null
, IE 11 sets the attribute to ""
whereas all other browsers actually set the attribute to "null"
. In createTooltips
, this predicate looks for a truthy title
attribute or html
setting. The predicate is essentially skipped for all browsers aside from IE 11 (unless ""
was explicitly passed in as the title
) since "null"
is not falsy.
The other problem with this predicate is that it is checking the html
setting which does not seem to be the intent, since the html
prop is stored as the reactDOM
setting on this line. Also, the html
setting was introduced in this changeset line which does not touch the predicate in createTooltips
.
These changes fix the IE 11 issue for me; they also do not affect the behavior in other browsers and the test app works.
@tvkhoa any interest in merging/releasing this?
@Merbs @brien-givens sorry for late reply, those all changes and fixes should be included in the latest changes (along with the upgrade to 16.x React), please check if that suit your case?