Open nileLivingston opened 6 years ago
Hi, Are you able to share your JS file code fix? I am running into the same issue.
Sure thing; you'll find my modified code attached.
(Apologies for the file extension, GitHub won't allow me to attach a .js file)
Thanks! Appreciate it. I have verified this fix works in mobile.
First off, thanks for the fantastic plugin. I get a lot of use out of it, and I'm happy to see it so well-supported.
I noticed that the
data-selectedtext
attribute doesn't work on mobile. This is the case for the official example, so I'm confident the bug isn't an artifact of my implementation.The issue appears to originate in the
_updateMobileText
function, on line 2945:self._setText(self.dropdownText, currentText);
which doesn't contain any references to
selectedText
. I fixed it locally by first definingcurrentDataSelectedText
inside of_updateMobileText
, as it is elsewhere in the source code:currentDataSelectedText = currentOption.attr("data-selectedtext");
And then by replacing the erroneous line 2945 with the following:
self._setText(self.dropdownText, currentDataSelectedText || currentText);
Thanks again!