Control.TextArea and cursor position
Hmmm... I think this i a change that I need to make in the core library. That does make a lot of sense though. It just has to do with the string length and substring bits. Thanks for posting in detail about this! It'll get fixed in the next release.
Posted July 10th, 2007 at 1:02am by ryan
That would be great! Any ruff idea when it would be released? Don't want to sound pushy, just wondering.
Posted July 12th, 2007 at 10:17pm by Agent G
Not wanting to sound pushy either, I just wanted to add my support for this and wondered when this could be included. It would be my only 'complaint' about Control.TextArea.
Posted September 5th, 2007 at 6:04am by jdmartin
First off I'd like to say I think Control.TextArea is a really nice piece of coding. From a user and programers perspective it's simple and to the point... as it should be! I was playing with TinyMCE before this, and while TinyMCE is nice, it's too bloated and buggy for my needs. Control.TextArea on the other hand works the same in every browser I've tied it. When I include AJAX enabled forms it just works... again, as it should! Plus the UI is clear and to the point.
There is however one point I'd like to improve. If you select some text and hit the bold (or any other) button it wraps the bold tags around your selected text... but, if you hit the bold button and you don't have any text selected... Control.TextArea puts the beginning and ending bold tags in the textarea as expected, but the cursor is positioned behind the closing tag. So the next text a user types is not bold and you have an empty bold tag with nothing between it. As someone who understands tags I can easily hit the back arrow a few times to get my cursor where I want it, but I doubt most users of my forum will be that savvy. I'm using Control.TextArea with BBCode (but this issue appears to be present in markdown and textile versions as well).
Anyone have a work around? Know where to point me? I'm new to JavaScript (mostly worked on server side scripting), so forgive me if this is a dumb question. phpBB 2 & 3 do this so I know it's possible, but I'm confused on how to pull it off.
Thanks, G
Posted July 9th, 2007 at 9:40pm by Agent G