Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@santisiri after considering and partially trying out other ideas [1], I concluded the best way to fix the modal unresponsive React links in the mobile view was to use the package
react-fastclick
. Looks like this is a somewhat common issue, and this solution seemed to be more appropriate.After testing it out it looks like the
react-fastclick
works fine. Thing is using the package brought my attention to what seems to be a slightly different bug. Modal renders fine and all links work correctly except 'recover password'. After looking into, it seems to be related to the code logic to render and autoposition the modal. Let me elaborate on that, this is what the form forForgotPassword.jsx
is supposed to look like:Behavior I see is: I click on 'recover password', modal renders for like a fraction of a second, then goes away (easier to visualize using Google Chrome Tools debugger). However if I add at least one more field input
<div>
:The modal renders and does not go away. With the regular
ForgotPassword
form, modal height seems to not be correct and somewheremodalPosition()
is getting invoked again and messing up the autoPosition.So a few things:
subscribe.js
is the best place toinitReactFastclick();
?[1] Other options included adding the
onTouchStart
event listener in every React component with anonClick
listener. Not the most elegant solution in my opinion and, as a matter of fact, not even completely efficient because this brought up a series of double-firing onTouch-onClick mess.Also looked into adding attributes conditionally but that seemed to bring up the same sort of issues mentioned above.
Some resources I looked at:
JedWatson/react-tappable#41
facebook/react#2055
https://stackoverflow.com/questions/40035230/how-to-conditionally-add-attributes-to-react-dom-element
facebook/react#436 (comment)
Addresses #208