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

Cannot select text within input inside a scrollable view #1475

Closed
bostondv opened this issue May 22, 2014 · 14 comments
Closed

Cannot select text within input inside a scrollable view #1475

bostondv opened this issue May 22, 2014 · 14 comments
Assignees

Comments

@bostondv
Copy link

On a desktop browser (tested Chrome and Firefox latest) the text content of an input or textarea within an cannot be manipulated with the mouse cursor.

This codepen demonstrates: http://cdpn.io/oywDJ

The input can receive focus and using the keyboard text can be added and deleted but text cannot be selected nor can you use the mouse to place the cursor as it instead seems to always put the cursor at the beginning or end of the text.

I would expect the behaviour to allow click and drag to select text within the input as well as the cursor to appear in the position clicked.

Thanks!

@gigablox
Copy link

+1 Definitely some weird behavior going on here.

@perrygovier
Copy link
Contributor

thanks for the example. how important is that to you? there's some debate about how much to support mouse specific interactions on a mobile framework and community feedback would be helpful.

@gigablox
Copy link

While that may be the focus now lets keep in mind that desktop browser support is still nearly half the market share - the obvious answer seems like there should be a shared priority.

Saying desktop browsers aren't a priority makes a lot of assumptions about how a developer may actually use the framework too.

For example: I am currently building a web app with Ionic and when it's done I will use build scripts to tailor the experience for Android/iOS apps. This allows me to keep a unified code-base, which is very, very powerful.

@bostondv
Copy link
Author

The project I'm currently working on where I discovered the issue has a requirement for both a desktop web app and a mobile app. Like @gigablox we built a unified code-base for all platforms using Ionic. So in this case, it's very important to me.

For the most part Ionic works very well on the desktop browser and I think supporting that use case just makes Ionic all the more compelling.

@perrygovier
Copy link
Contributor

I'd caution that Ionic is a mobile framework, so YMMV when it comes to desktop stability, especially on older browsers like IE 8 or 9. We do usually develop on desktop though, and support for modern browsers is pretty good just by coincidence. I can't guarantee that all desktop only bugs will be addressed, but this one should get fixed.

@gigablox
Copy link

Yea I mean I can't speak on @bostondv 's behalf but I feel like it's reasonable to ask for IE10+ bug fixes that are seemingly critical. I wouldn't expect support for IE8 or IE9 because then I would be a terrible human being haha.

@bostondv
Copy link
Author

I agree, but glad to hear this one should get fixed :)

@cayter
Copy link

cayter commented Jun 5, 2014

+1

@erivan
Copy link

erivan commented Oct 15, 2014

i have the same problem..

@BrianPurkissClarity
Copy link

I'm having the same problem.

Text is not selectable on the desktop or on mobile. And not being selectable on mobile is the bigger concern, it means that people cannot copy/paste the text in my app. Which is quite important.

@eeschiavo
Copy link

After two years I have the same problem, also on mobile!! Is there any solution? Thanks

@ChrisGibb
Copy link

2018 still a problem. Guys this is a silly bug to have. Ionic works great on desktop but this is a behaviour that's very strange for users who are used to selecting text with the mouse.

I understand "focus" might not be on desktop, but this can't be hard to fix. If you could allow us to to call
this.slides.lockSwipes(true) to disable what ever drag handlers are there, that would surely do the trick.

Please guys!

@ChrisGibb
Copy link

ChrisGibb commented Aug 23, 2018

@eeschiavo @BrianPurkissClarity @erivan Here's my nasty hack to fix this issue.

ngAfterViewInit(): void {
 setTimeout(() => {
  try {
   (this.slides as any)._unregs[0]();
  } catch (e) {
   console.error(e);
  }
 }, 1000); <---- experiment with this
}

This is a very rough fix and I'm in a hurry to fix an issue for a client so still need to check if there's any serious negative side effects from doing this - apart from the obvious that you can't drag the slides anymore, in my case doesn't matter because I have buttons for this.

But anybody else coming here you can try this approach.

@IonicProSupport it would be nice if we had a nice public function for accessing _unregs. Then we could disable the ion-slides events properly. It would also be nice to get a callback when the pointer-events have been initialised to avoid the nasty setTimeout I had to do

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 22, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants