Sign in to follow this  
ForD

[web] Empty Selection/Range object in Opera

Recommended Posts

ForD    122
For certain reasons, I need to know the index of an empty selection of an html element, I can do this fine in firefox and ie, however, Opera always reports the begin and end index of the selection as 0 if the selection is empty. Does anyone know of a way around this?

Share this post


Link to post
Share on other sites
kanzler    358
Check your call to window.getSelection().rangeCount. It seems Opera denies the existence of empty selections and returns 0 for window.getSelection().rangeCount. My solution: Ditch support for Opera until they support standards for 100%, not 99%.

Share this post


Link to post
Share on other sites
ForD    122
Quote:
Original post by kanzler
Check your call to window.getSelection().rangeCount. It seems Opera denies the existence of empty selections and returns 0 for window.getSelection().rangeCount. My solution: Ditch support for Opera until they support standards for 100%, not 99%.

I might do this, but I'd rather not. Mainly because I use Opera as my primary browser. Any other suggestions?

I was thinking maybe I could find the index of the selection based on the pixel cooridnates of the mouse, but I'm not really sure how to go about implementing it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this