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
Ability to create readonly elements that can be selected by users #1034
Comments
One question I have is, how is this different then contentEditable? If you could create either a codepen or pull request to show how it would work we'd be happy to review it. However, I may not be understanding the problem and solution entirely, but this feature sounds rather specific and may not be a good fit to go into the core, but rather a contribute file. |
The difference is the fact I want the data that they select to be readonly - contentEditable is about making the content editable? Happy to make a contribute file if you think that's the right way to go, but given the code that disables the user interaction is buried in the core in "private" code that can't be monkey patched I'm not sure how so any guidance would be fantastic :) |
So it sounds like something similar to how we have http://ionicons.com If you click the classname for any icon it'll auto select it, but the input is also set to readonly. Is this what you mean? |
Spot on :) |
I see the use case, but it might be too specific to put into the core. It wouldn't be much code, but at the same time not many people would need to use it. We're planning on making it easier to have contrib files that extend ionic, so something like this would be a good candidate for that, thanks. |
No worries - are you able to point me in the right direction for how to create one of these contrib files? |
Sorry, not at the moment, but stay tuned as Ionic grows. Thanks |
Sure thing - is there a github issue I can subscribe to or should I just keep an eye on the changelog / release notes? |
These should keep you up to date: https://github.com/driftyco/ionic#community |
Awesome! Thanks mate - great work on the framework; it's been amazing using it so far :) |
I'm building a chat app, and would like to make the text from chat items selectable, e.g. to copy a address or phone number someone messages to you. It'd be great to have this ability. Is it possible to at least describe how achieve this, without core support, since 'It wouldn't be much code'? Thanks. |
It would have been helpful to post the solution you came up with.... |
@robdmoore, @cablehead @rcorrie :
if you are willing to edit ionicXXX.js, you could also check for a class or attribute anywhere they check isContentEditable... |
Does this discussion has a final conclusion? I think most of us need this function, is there any way to get the ability back to select and copy the text which belong to web browser. |
+1 I'm in the same boat as @zchking |
I think you are left with contentEditable until @adamdbradley and friends give us a way to patch it... |
+1 also needing this |
For those that have just entered or may be searching this plugin http://ngcordova.com/docs/plugins/clipboard/ is helpful if you want to implement similar functionality via a button |
We Just need the text to be selectable not editable that's why we can't use contenteditable property of HTML and in normally we can copy any content but in ionic i think you guys have made it that none of text is selectable. Please provide solution other the below which doesn't require ionic.js changing |
I got it working without modifying ionic.js. The trick is to replace text you want to be able to select with input field with attribute Check the whole code here: |
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. |
I have a requirement for an app I'm building to have an area on the screen that is readonly, but the user can select in order to use the copy command.
As per #421 at the moment you can only select text in form elements and contentEditable divs so I propose that there is a way to add a control where you opt in to allowing selection.
I'm more than happy to implement it and send through a PR, but some initial brainstorming on the best approach to opt in (or letting me know if you have a fundamental objection to it) would be great before I start.
The text was updated successfully, but these errors were encountered: