Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tap To Select Not Working (on iPhone) #13

Closed
eric-lobdell opened this issue Jun 23, 2016 · 16 comments
Closed

Tap To Select Not Working (on iPhone) #13

eric-lobdell opened this issue Jun 23, 2016 · 16 comments

Comments

@eric-lobdell
Copy link
Owner

eric-lobdell commented Jun 23, 2016

http://www.lobdell.me/emoji-gram
-- Test from mobile safari / mobile chrome. The button doesn't actually make a selection of the text.

  1. open /ohno3/ on mobile web browser
  2. type "test"
  3. press [select text] button
  4. nothing happens.
@eric-lobdell eric-lobdell changed the title Select Text Button Not Working Select Text Button Not Working (on mobile) Jun 23, 2016
@eric-lobdell
Copy link
Owner Author

I found that if you:

  1. press and hold the button until the button text is selected
  2. then tap an area of the button that is not selected
  3. somehow output text is then selected

@amitava82
Copy link
Collaborator

It works on Android Chrome. But why do you have the button say press n hold? Tapping the button selects all text and places on clipboard(in chrome). Earlier labels were more meaningful. Perhaps for safari it should not say 'Copied'

@eric-lobdell
Copy link
Owner Author

eric-lobdell commented Jun 24, 2016

Ah, I have it say that because on iPhone Safari and iPhone chrome the button won't actually do anything when you tap. I found that if you press and hold (above comment), it'll allow you to select all of it.

Do you have access to an iOS device to test on?

@eric-lobdell eric-lobdell changed the title Select Text Button Not Working (on mobile) Select Text Button Not Working (on iPhone) Jun 24, 2016
@amitava82
Copy link
Collaborator

Nope. On Android if you press and hold the button, it will select button text. Does not tapping on the select button select the emoji code? It should. Selection is supported in safari. Ideally it should say Select and on device that supports clipboard it should copy and button changed to Copied. Otherwise, it should not say Copied.

@eric-lobdell
Copy link
Owner Author

eric-lobdell commented Jun 24, 2016

No when you tap the button, nothing happens. That's why I changed the button text.

The press and hold has the same effect on mobile safari, but once you tap to deselect the button text, it somehow magically selects the emoji text. So it's a "hack" until we can resolve why a single tap on the button isn't selecting the text.

I'll do a screen record so you can see.

@eric-lobdell
Copy link
Owner Author

eric-lobdell commented Jun 24, 2016

Check it out https://www.dropbox.com/s/2bdvnpynd56nzrm/issue2.mov?dl=0

You can see, I tap the button (it changes text every tap) multiple times before I press and hold it. Once I press and hold, it behaves just like you android, but then one more tap, and somehow all the text is selected.

Is there anything I can do to help troubleshoot?

@amitava82
Copy link
Collaborator

Tap to select needs to be fixed.

@eric-lobdell eric-lobdell changed the title Select Text Button Not Working (on iPhone) Tap To Select Not Working (on iPhone) Jun 24, 2016
eric-lobdell pushed a commit that referenced this issue Jun 25, 2016
fixes #13 and weird safari and messaging bug
@eric-lobdell
Copy link
Owner Author

eric-lobdell commented Jun 25, 2016

I just packaged the latest: http://lobdell.me/emoji-gram/

iPhone still doesn't want to select the text 🤔 However it looks like the Safari / iMessage react issue is totally resolved!! That's awsome!!

I ran: "npm run build" then copied the files to my server after linking the css file. Is it possible something is getting messed up in the packaging process?

@eric-lobdell eric-lobdell reopened this Jun 25, 2016
@amitava82
Copy link
Collaborator

OK, I found mobile safari don't support the API used for text selection. I tried using a textarea (so that we can select text) but then there is this weird , comes before newline. I'll have to play around bit more.

@eric-lobdell
Copy link
Owner Author

Would this be a simple way to fix this?

http://stackoverflow.com/questions/1899421/selecting-text-in-mobile-safari-on-iphone

Not just the first answer, but a couple people down the thread seem to have fixes working for them. Just poking around.

@amitava82
Copy link
Collaborator

Need an iphone to test :(

@eric-lobdell
Copy link
Owner Author

eric-lobdell commented Jul 6, 2016

Dang. I tried to plugin my iPhone and use the developer console for a debug, but no errors / warnings appeared. So, no help 👎

Anyhow, I took to the internet again: http://stackoverflow.com/questions/38233871/auto-select-text-range-in-mobile-safari-ios-9-reactjs -- maybe someone can help us!

@amitava82
Copy link
Collaborator

amitava82 commented Jul 7, 2016

Hmm, only workaround is using a textarea but I'm not sure where that , comes from after every new line. I'll have to take another look.

@eric-lobdell
Copy link
Owner Author

eric-lobdell commented Jul 9, 2016

It looks like the latest bugfix only brings up the keyboard when you press the button. It's acting like the text area is being focused instead of selecting everything.

www.lobdell.me/emoji-gram -- is the latest master + bugfix.

@eric-lobdell
Copy link
Owner Author

eric-lobdell commented Jul 9, 2016

I recorded the new behavior (each time the keyboard moves up, it's a tap on the button) here:

comp 1

@eric-lobdell
Copy link
Owner Author

Resolved with:
this.selectionStart=0; this.selectionEnd=this.ele.length;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants