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

Input Fields With Text Throws IndexSizeError: Index or size is negative or greater than the allowed amount #1349

Open
zyphersworld opened this issue Mar 4, 2015 · 8 comments

Comments

@zyphersworld
Copy link

I'm using firefox 36 and discovered that when i click a text input field with text
I get an "IndexSizeError: Index or size is negative or greater than the allowed amount" error

This seems to effect the alohaUI demo (http://www.alohaeditor.org/demo/aloha-ui/) if you try to edit a link in firefox you cannot it keeps editing the page

I made a test. I hope someone here can shed some light on the problem.
http://codepen.io/anon/pen/vEaeXb

EDIT: all is ok in Chrome

@zyphersworld
Copy link
Author

Well, i'm a newbie at contributing to software projects so i hope i'm doing this right ....

The IndexSizeError is not related to the problem of not being able to edit the href property using aloha-ui-links.js . upon futher investigation i found that the href property is editable in firefox if the link text is selected, however when a link is clicked using aloha-ui-links.js the text is not highlighted.
i modifed the open function in aloha.ui-links.js and added this:

    var range = document.createRange();
    range.selectNodeContents(anchor);
    var sel = window.getSelection();
    sel.removeAllRanges();
    sel.addRange(range);

after the line: Dom.addClass(anchor, 'aloha-active');

and now the link can be edited in firefox. :)
Now as i said i'm a newbie at this so what do i do now?

@petrosalema
Copy link
Member

Confirmed. I can reproduce this in FF with the CodePen example.

@hackel
Copy link

hackel commented Apr 23, 2015

I just came across this issue myself. It doesn't look good when your own demo doesn't function as advertised! Glad that there is now a solution.

@zyphersworld Create a fork of this repo in your own account (upper-right corner), push the necessary changes to your repo, and then create a pull request back here so that they can (hopefully!) merge them.

@zyphersworld
Copy link
Author

I have forked and updated code in aloha.ui-links.js in the howling-mad branch. now i just need to sign the Aloha Editor contributor license agreement (CLA) and create the pull request.

@zyphersworld
Copy link
Author

have created a pull request and now awaiting admin to verify patch. This is my first ever contribution to a software project where i am not the only developer. I hope to add more. maybe i should should look into the problem that I originally was talking about here :)

@petrosalema
Copy link
Member

Hi @zyphersworld. We got your signed CLA. Thanks for submitting your patch.
I'm going to take a look at it myself.

@zyphersworld
Copy link
Author

Hi @petrosalema. is there any progress being made on this? just wondering where it's up to and if you would have any comments or suggestions regarding my patch. thanks

@hackel
Copy link

hackel commented Sep 16, 2015

Well, it's been over 6 months with a solution provided. Any action on this? I'm afraid I'm going to have to switch to a more stable/mature editor for my project if these kinds of issues aren't resolved soon!

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

No branches or pull requests

3 participants