W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2004

[whatwg] Standard method to get/set caret position

From: Ian Hickson <ian@hixie.ch>
Date: Fri, 12 Nov 2004 10:30:49 +0000 (UTC)
Message-ID: <Pine.LNX.4.61.0411121029370.8631@dhalsim.dreamhost.com>
On Sun, 29 Aug 2004, Jim Ley wrote:
> On Sun, 29 Aug 2004 16:44:56 +0000 (UTC), Ian Hickson <ian at hixie.ch> wrote:
> > On Thu, 26 Aug 2004, Ted Mielczarek wrote:
> > >
> > > While working on a javscript tool, I needed a way to get and set the 
> > > caret position in a textbox.
> > 
> > Interesting. Just out of curiosity, what is it that you were doing 
> > that required access to the caret position? If I may ask.
> 
> The typical use case for this, is some sort of rich editor, where a user 
> can use a button to add some sort text content into a text area, so 
> perhaps you'd have a button to add an email address from your address 
> book into an email you're authoring (ie to send to someone else)
> 
> For webapps this would certainly be common requirements, as to what's 
> best to do, I've not thought about it yet...

Yeah, that makes sense. I could imagine an API having something like "wrap 
the selection in this markup" or "insert this markup at the current cursor 
position". I'll look closely at what contentEditable APIs are like here.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Friday, 12 November 2004 02:30:49 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:20 UTC