Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Selection is lost when button is clicked in Safari 1.3



Thanks for the reply.

If the required action is simply to call execCommand, the onClick event seems to work fine. Note that in my case the html text is in an iframe. The buttons are on the main window.

But for more complex scripts that need to work on selections and ranges, unless I have done something wrong, it seems that the properties of the selection returned by the getSelection() method are wrong. These properties are identified in another thread of this list.

For example, I have been unable to build the range corresponding to a simple text selection using the following sequence:
var sel = window.getSelection();
var range = document.createRange();
range.setStart(sel.baseNode, sel.baseOffset);
range.setEnd(sel.extentNode, sel.extentOffset);

I have seen no difference from within the onMouseDown event.

Stanislas

mark malone a écrit :
Using onMouseDown instead of onClick allows you to get the event and call the appropriate execCommand value before the selection is lost.

-Mark
On May 13, 2005, at 2:44 PM, email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webcore-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webcore-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: Selection is lost when button is clicked in Safari 1.3 (From: mark malone <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.