|
Rank: Newbie
Groups: Registered
Joined: 3/19/2015 Posts: 8
|
Hi,
I have a few issues with dynamically created textAreas. We have a complex program, where the elements are mostly created dynamically, so we're trying to integrate Keyoti with them.
1. When I call rapidSpell.ayt_setupTextBoxes(true); mid-run, it makes some glitches(For a Split second, shows Horizontal and Vertical ScrollBars), and takes a bit of time. The case is very similar to the one described in AJAX & DHTML Type Usage. Is it possible somehow to avoid calling this function mid-run, and setup all the textareas at startup? (Assuming they are known, just hidden). (It was checked on chrome)
2. It also makes issues on Internet Explorer, and Firefox. In firefox- the textAreas flicker a few times before being constructed. In Explorer it crashes- **although I haven't finished investigating this issues to the fullest**
In conclusion: 1. What exactly happens when the javascript code of the function rapidSpell.ayt_setupTextBoxes(true) searches for the textAreas? 2. Is it possible to avoid the solution described in AJAX & DHTML Type Usage , and somehow setup the boxes on startup?
Thanks.
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
Hi, when you run rapidSpell.ayt_setupTextBoxes(true) it scans the DOM for visible textboxes and creates the iframe replacements for the textboxes. The reason it cannot just do this at startup is because of how the browser handles sizing - we have to replace the textbox with an iframe and to do that we need the size of the textbox, but we cannot get the size until the textbox is visible. At least that's my understanding of the issue. Best Jim -your feedback is helpful to other users, thank you!
|
|
Rank: Newbie
Groups: Registered
Joined: 3/19/2015 Posts: 8
|
Alright- I understand why, thanks. But what about the scroll Bars? The textAreas initially don't have scroll bars if not needed. But the following happens when executing the boxSetup: In Chrome- they flicker for a second and returns to the initial state, which makes it a bit ugly. In Morfix- they flicker for longer, and the Vertical one stays in place.
I've checked it on a clean code as well: var div = document.getElementById("form1"); var input = document.createElement("textarea"); input.id = "id" + count; input.overflow = "hidden"; count++; input.maxLength = "100"; input.cols = "10"; input.rows = "10"; div.appendChild(input); //appendChild rapidSpell.ayt_setupTextBoxes(true);
And the Same happens- the scroll Bars appear- only hear both scroll bars appear. From my understanding there is a modification of the textArea- and that's what I don't want to happen.
Thanks
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
Thanks, I see what you mean - easy fix, please update your script to this version. New releases will use this too. https://www.dropbox.com/.../RapidSpell-AYT.js?dl=0
Best Jim -your feedback is helpful to other users, thank you!
|
|
Rank: Newbie
Groups: Registered
Joined: 3/19/2015 Posts: 8
|
It fixed the flickering, but in firefox the scrollBar still appears.
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
Looks to be caused by an old workaround for older FF versions - should be OK now. https://www.dropbox.com/...ell-AYT.js?dl=0&t=3
Jim -your feedback is helpful to other users, thank you!
|
|
Rank: Newbie
Groups: Registered
Joined: 3/19/2015 Posts: 8
|
It disappeared in firefox. 1. Now I see that in internet explorer the scrollBar appears. 2. There is still some flickering when it appears in firefox, and much more in ie, it's pretty visible. (Thanks for the quick replies)
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
1. That's because by default textareas in IE have a vertical scroll bar. Eg. try this <textarea id="Textarea1" cols="30" rows="10" tabindex="1" nospell="true">hiii</textarea> gives you a non spell checked textbox, with a y scroll bar. If you explicitly remove it, eg. textarea id="rswit_compare1" cols="30" rows="10" tabindex="1" style="overflow-y:auto">hiii</textarea> then even for our textbox the scrollbar is removed. So I think it's just a browser difference. 2. I don't see any in my test, it could be specific to your page design. Could you create a runnable mockup and send to me please? Thanks Jim -your feedback is helpful to other users, thank you!
|
|