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

IOS compatibility #37

Closed
Gozala opened this issue Jan 11, 2011 · 160 comments · Fixed by #2555
Closed

IOS compatibility #37

Gozala opened this issue Jan 11, 2011 · 160 comments · Fixed by #2555
Labels

Comments

@Gozala
Copy link
Contributor

Gozala commented Jan 11, 2011

Ace could be a ideal editor on IOS devices (iPad, iPhone) if you just could type, but unfortunately virtual keyboard never shows up with ACE, also I believe someone had a patch for bespin to make that work.
@Gissues:{"order":96.27329192546586,"status":"backlog"}

@sergi
Copy link
Contributor

sergi commented Jan 11, 2011

We know, and it will be taken care of soon. Thanks for the suggestion!

@fjakobs
Copy link
Contributor

fjakobs commented Jan 11, 2011

could you lookup the patch for us?

@glaforge
Copy link

I'm also interested in iOS (and particularly iPad) support.
Looking forward to hearing about your progress on that front.

@fjakobs
Copy link
Contributor

fjakobs commented Feb 11, 2011

You can checkout the ipad branch. It is not perfect yet but at least typing works. Use two fingers to scroll.

@glaforge
Copy link

Excellent, I hadn't noticed the ipad branch.
Thanks, I'll have a look at it!

@SunboX
Copy link
Contributor

SunboX commented Mar 1, 2011

The keyboard didn´t show using the ipad branch. Using the master branch it shows, but there´s a bug with the cursor positioning. :/

@SunboX
Copy link
Contributor

SunboX commented Mar 3, 2011

Forget what I've said! It's cool that the keyboard didn't show up! You could write your own keyboard, much friendlier for programmers and less space consuming. :o)

@bvibber
Copy link

bvibber commented Apr 15, 2011

Testing on iPad running iOS 4.3; current master fails to show keyboard or insertion point, and doesn't scroll vertically (I can scroll horizontally with two fingers, if the text is wider than the available area).

iPad branch hasn't been updated since February 3... testing it, I see that vertical scrolling works with two fingers (yay!) but is very slow. I can put focus into the editor and pop up the on-screen keyboard, but the insertion point ends up flying off away from the editor when the window scrolls up to fit the keyboard.

Trying to tap around the editor seems problematic; I can sorta tap within the line being edited, but tapping other lines above seems to lose focus and closes the keyboard. I can only reliably put focus at the end of the document.

While scrolling vertically, the insertion point seems to jump up/down a line at a time, but when I start typing, it jumps back to the end of the document to add new chars.

@bvibber
Copy link

bvibber commented Apr 15, 2011

(iPad branch on regular Firefox 4 also has issues -- it seems to make assumptions about the window's scroll position, and clicking in the editor ends up placing the caret at wrong position if I've scrolled the window down to fit the editor in the visible space.)

@dmmalam
Copy link

dmmalam commented Jul 17, 2011

any updates on the ipad branch?

@fjakobs
Copy link
Contributor

fjakobs commented Jul 23, 2011

Unfortunately not. This branch is currently not under active development. We plan to resurrect it but we have no estimated time when.

@andrewheiss
Copy link

Sorry to resurrect a dead thread, but has there been any progress on the iOS front?

@levous
Copy link

levous commented Mar 29, 2012

Obviously, there is massive interest in this. Ill take a look and see if I can help

@hjwp
Copy link

hjwp commented Apr 2, 2012

+1

@matthew-dean
Copy link

A web-based component that doesn't support the iPad can no longer be rightfully called a web-based component, IMO.

@abacon
Copy link

abacon commented Apr 5, 2012

I second this. I'm writing on an iPad right now, wishing that I were using ACE to be programming instead...

@velniukas
Copy link

+1 need this pretty urgently too on iPad

@cranic
Copy link

cranic commented Apr 6, 2012

+1 to the urgency

@PlayMyCode
Copy link

I would also like iOS support too, and very soon. If I can find the time, I'd be happy to sit down and do this myself. So if there are any pointers on where I should get started in the code, and details on how it's going wrong, it would be appreciated.

@velniukas
Copy link

Agreed - I would contribute to a kickstarter fund to complete this if need be

On Sat, Apr 7, 2012 at 2:53 PM, Joe
reply@reply.github.com
wrote:

I would also like iOS support too, and very soon. If I can find the time, I'd be happy to sit down and do this myself. So if there are any pointers on where I should get started in the code, and details on how it's going wrong, it would be appreciated.


Reply to this email directly or view it on GitHub:
#37 (comment)

@cranic
Copy link

cranic commented Apr 7, 2012

There's no way of bringing that damn keyboard up with javascript, thumbs up for a custom keyboard.

@PlayMyCode
Copy link

Not true. Assign an element as content editable and them give it focus, and the keyboard should appear. You could also do tricks with textsreas and text inputs to get it working.

The keyboard also comes up with the version of Ace I'm using on my site, it's just not usable.

@cranic
Copy link

cranic commented Apr 8, 2012

@PlayMyCode If I can't call someting like ios.showKeyboard() than it's true that I can't bring it up whit javascript, this what you said are all quick fixes...

@PlayMyCode
Copy link

It just doesn't work like that.

If the content isn't editable, or if it's not a text input, why would the keyboard be displayed? The characters won't go anywhere, you will not receive input from the keyboard.

The keys have to go somewhere for the keyboard to be displayed. If they don't have anywhere to go, then it doesn't appear. If they do have somewhere to go, it will appear. That's not a hack, it's just how text entry works.

@hjwp
Copy link

hjwp commented Apr 8, 2012

@PlayMyCode - characters don't necessarily need a textinput to go to, they could just "go" to javascript -- if you had a set of keypress listeners, you'd be able to get the characters and put them wherever you wanted...

@PlayMyCode
Copy link

@hjwp your right, but again it's not that simple. I believe the elements must be able to obtain focus, or the browser will not send the event to the element, and many elements cannot receive focus. For example the canvas will only listen to key events if you add a tab index (or at least I am finding this just now in Chrome). iOS also only brings up the keyboard for canvas if you set content editable.

Either was this is an academic argument. iOS support is what is important, and it shouldn't be sidelined simply because a solution looks too much like a hack (unless of course there is a better alternative).

@SunboX
Copy link
Contributor

SunboX commented Apr 9, 2012

How about putting the focus on an hidden text input and clearing this on keypress?

@matthew-dean
Copy link

Yep, that's how many WYSIWYGs work.

On 2012-04-09, at 4:56 AM, "André Fiedler"
reply@reply.github.com
wrote:

How about putting the focus on an hidden text input and clearing this on keypress?


Reply to this email directly or view it on GitHub:
#37 (comment)

@matthew-dean
Copy link

Wasn't older versions of Ace positioning a textarea or input element under entry, originally? That approach will bring up the keyboard.

@nightwing
Copy link
Member

Wasn't older versions of Ace positioning a textarea or input element under entry, originally

new versions of ace do the same.
textarea goes out of sync with cursor while scrolling but that's easy to fix
i haven't seen ace on the ipad but on android typing and moving cursor around works, only there's no way select text.
but more importantly

  • ace on android browser is super slow, fennec is a little bit better but still unusable (maybe using setTimeout here with longer interval could help but not sure)
  • default keyboard and autocompletion suggestions are completely useless for programming (so making custom keyboard instead of trying to show default one seems like a good idea).
    overall i don't think ace can be useful on tablets yet.

@paladox
Copy link
Contributor

paladox commented Nov 19, 2015

IPhone 6 plus ios 9.2 public beta seems to work well now with ace. Scrolling works and editing works as if your on computer.

Just needs improvements in copying and pasting.

It is possible to paste and copy but very hard to do it.

@jeremy50dj
Copy link

Http://www.apus.com
On Nov 19, 2015 10:52 AM, "paladox" notifications@github.com wrote:

IPhone 6 plus ios 9.2 public beta seems to work well now with ace.
Scrolling works and editing works as if your on computer.

Just needs improvements in copying and pasting.

It is possible to paste and copy but very hard to do it.


Reply to this email directly or view it on GitHub.

@Bennimaxx
Copy link

I have problems with the arrow keys on my IPad keyboard. The keyboard works fine in every environment but if I connect to my cloud 9 Server and start to programming, the arrow keys are ignored. Can I add them somewhere or how can this be fixed? I need the arrow very often while coding.

@hocker-app
Copy link

<div id="editor" class="page-content" contenteditable="true"></div>

Does the trick in iOS. Just can't seem to get assembly_x86 syntax highlighting to work.

@Bennimaxx
Copy link

Where do I have to include this code? I thought this must be in the user.settings but there It has no HTML parts

@hocker-app
Copy link

HTML inside a WebView.

@facundomedica
Copy link

Can't get it to work inside a UIWebView 👎 It starts ok, but as soon as I try to move the cursor, everything fails. I cannot write, or with @jcss-org-il solution (<div id="editor" class="page-content" contenteditable="true"></div>) the cursor moves outside the editor.

@realgenekim
Copy link

realgenekim commented Aug 18, 2016

Can someone help me solve a mystery? The GitHub online code editor, allegedly based on Ace (https://github.com/blog/905-edit-like-an-ace), is amazing. It runs flawlessly on the iPad, including with a Bluetooth keyboard, the arrow keys work (including Ctrl-Left Arrow, Alt-Left Arrow, etc), and performance is great, etc.

Here's a screenshot of an iPad editing session of the README.md file of this repo: (https://github.com/ajaxorg/ace/edit/master/Readme.md)

img_0819

And yet, everyone on this thread (myself included), can't get Ace to run on an iPad without problems (e.g., arrow keys don't work). (I have the same issues as reported here: #37 (comment))

Is GitHub running a custom version of Ace? Is that version publicly available? I'd love to run whatever they're running! (Screenshot of DOM inspector confirming that it appears to be running Ace at bottom.)

Thank you so much!
G

editing_ace_readme_md_at_master_ _ajaxorg_ace

@nightwing
Copy link
Member

@realgenekim from screenshot it looks like github uses a textarea on ipad

@realgenekim
Copy link

@nightwing Fascinating theory! But, if you look at the editor control, there are line numbers, Ace-like capabilities that seem like it's not just a standard HTML textarea, like tab width, text wrapping...

Upon some closer inspection, I'm pretty sure it's something more exotic than textarea!

@nightwing
Copy link
Member

@realgenekim line numbers are only in the second screenshot, which doesn't look like ipad

@realgenekim
Copy link

realgenekim commented Aug 24, 2016

@nightwing Holy cow. That's so intriguing — I think you're absolutely correct. I'll try to get some confirmation of this from someone at GitHub...

I think this means I'll try doing the same thing. I.e., detect at run-time whether it's an iPad, and not load Ace editor, and instead just use a textarea.

So unsatisfying, but at least it will be usable until someone comes up with a good iPad solution...

😦

@ebertmi
Copy link

ebertmi commented Aug 24, 2016

Just tested this on my iPad pro and it basically shows an basic textarea. Maybe with auto grow.

@barneycarroll
Copy link

Is it something clever like a textarea with 0 opacity & an ace editor instance positioned immediately behind it? I imagine with modern iPad performance it would be possible to persist state (inner scroll & content) almost instantly on each input event…

@ebertmi
Copy link

ebertmi commented Aug 24, 2016

@barneycarroll No, at least in my tests I was editing inside a normal text area without line numbers etc.

@etamponi
Copy link
Contributor

etamponi commented Dec 20, 2016

Hey guys! I've just created a pull request that fixes some of the issues on iOS. It provides a nice user experience, if you've an external keyboard.

If you like it, I might think of fixing the remaining issues :)

You can see it in action on https://ipad-undo.gomix.me

Enjoy!

@IamNaN
Copy link

IamNaN commented Dec 20, 2016

Just using your demo and I'm seeing a problem with the insertion point. Create a pair of quotes, for example, put the cursor between them, and start typing. It randomly jumps to the end of the line. I'm not sure if this change introduces that problem or if it was there initially.

@etamponi
Copy link
Contributor

etamponi commented Dec 21, 2016

Oh, thanks @IamNaN , that bug has been reported in the PR right now :) I think I know how to fix it... stay tuned on the demo :)

EDIT: demo fixed :)

@geyang
Copy link

geyang commented Jan 11, 2017

@etamponi That look awesome! Does it work with:

  1. Plug in like vim and emac?
  2. IME support with CKJ?

Currently it looks like it messes up when you turn on IME.

@etamponi
Copy link
Contributor

@episodeyang I am really sorry I left you on hold on this.

Unfortunately I didn't have the time to keep working on the PR... Luckily someone else took over my work and finished it, now it is merged as #3310 if I remember correctly :)

vim was already unsupported on iOS, and the PR doesn't add support for it. I don't know enough about IME to know for sure if my PR affected it in any way, sorry!

@adam
Copy link

adam commented Dec 11, 2017

Placing the cursor mid-word via a tap seems to be hit-or-miss (iOS 11.2, Safari) on the demo provided by @etamponi - Is there a way to make that more reliable?

@nightwing
Copy link
Member

Currently ace works well enough on IOS to close this issue about the basic compatibility. If you see any bugs or missing features, please open a new issue.

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

Successfully merging a pull request may close this issue.