Re: Why is the vBulletin RTE stopping me from preventDefault()?
"lacasseroland" <[email protected]> Wed, 07 Jun 2006 15:25:17 -0000
| Newsgroups | gmane.comp.web.dom.wdf |
|---|---|
| Message-ID | <[email protected]> |
Hi John, I tried all your suggestions before posting. > Try using the modern methods for attaching events Tried that before anything. I would have used the Flanagan W3C/IE/Legacy wrappers or the Yahoo ones: http://del.icio.us/metaw3/addEvent But it did nothing for my problem. So I reverted to the Legacy model because I want the favlet to be as small as possible. The favlet works fine even with the new Yahoo RTE: it inserts 2 non-breaking spaces. > useCapture: try false first, also try true Tried both as well. > event.stopPropagation(); Tried it too when I used the W3C event model to see if this was the problem. I also tried to play with the tabIndex property as I saw that form elements were having that attribute set: no results either. I think I will have no choice but to save a local copy with the problem, and go through vB code line by line. :( Christian --- In [email protected], "John M. Hann" <john.hann@...> wrote: > > Hi Christian, > > Try using the modern methods for attaching events (IE5+, FF1.0+, > Safari1.2+, Opera7+). It is possible that your events are getting > overwritten. (This also relieves your code from the duty of saving any > previous onkeydown events.) > > if (element.addEventListener) { > element.addEventListener(name, observer, useCapture); > } else if (element.attachEvent) { > element.attachEvent('on' + name, observer); > } > > name = "keydown" > observer is a reference to the event handler function > useCapture: try false first, also try true > > Also, try stopping the event propagation in addition to preventing hte > default (unlikely culprit): > > if (event.preventDefault) { > event.preventDefault(); > event.stopPropagation(); > } else { > event.returnValue = false; > } > > Regards, > > -- John > > http://e-numera.com/ > http://ajax-web2.com/ > > > --- In [email protected], "lacasseroland" <christian.fecteau@> > wrote: > > > > I don't understand why the latest RTE of vBulletin boards is stopping > me > > from preventDefault() > > > > It works fine in IE with returnValue, but not in Firefox/Safari/Opera > > where I need to use preventDefault. > > > > Here is a favlet I coded for me to use real tab to indent in textarea > > elements: > > > > page to bookmark the favlet > > <http://www.christianfecteau.com/echo/textedit/textedit_favlet.html> > > link to a forum with the problematic RTE > > <http://www.codingforums.com/showthread.php?t=88384> > > > > If you inject it on a board with the vB editor and press the tab key > in > > FF, the tab character is inserted in the textarea, but the focus is > > given to the next element in the form, which is what preventDefault() > is > > supposed to avoid. > > > > If anyone knows why, please tell me. > > > > Otherwse, I will comment lines of their JS one by one until I find the > > problem. > > > > Thanks. ------------------------ Yahoo! Groups Sponsor --------------------~--> Home is just a click away. Make Yahoo! your home page now. http://us.click.yahoo.com/DHchtC/3FxNAA/yQLSAA/9rHolB/TM --------------------------------------------------------------------~-> Unsubscribe [email protected] List info http://www.quirksmode.org/dom/list.html Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/wdf-dom/ <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/