[thelist] Event listener is deaf in Safari

J.J.SOLARI jjsolari at pobox.com
Mon Jun 6 04:03:05 CDT 2005


Hello,

I have some Web application based on event listenening.

Basically, the app lists a log entries, and each entry is contained
in a <li> element like this:

<ol>
<li>entry1</li>
<li>entry2</li>
...
</ol>

When page is loaded, an event listener is associated with each <li>
via an onload init script.

Following, if one clicks on a <li>, some regex'd part of its text is
taken as the value for a text <input>.

With all target browsers, clicking anywhere on a <li> would perform
as intended.

But Safari behaves differently.
If one cliks on the text of a <li> (its only child), the event
doesn't bubble up to the parent <li>, and nothing happens. However,
if one cliks directly on the <li> box (not on the text), the click
event is correctly processed.

Event listeners are set to bubble like this:
object.addEventLister( "click", theFunction, false ), where 'object'
refers to a <li>.

Is it a Safari bug, or am I missing something?

TIA,

JJS.


More information about the thelist mailing list