Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #9298 (closed defect: untested)

Opened 11 months ago

Last modified 8 months ago

[PATCH] Event.element() fails for keydown during refresh on IE6 and IE7

Reported by: blackymetal Assigned to: sam
Priority: high Milestone:
Component: Prototype Version: edge
Severity: major Keywords: event
Cc:

Description

Event.element(event); This used to work on v 1.5.0 IE6 but on the v 1.6.0 RC doesn't work, it gives me an error: 'nodeType' is null or not an object

Attachments

event_patch.patch (389 bytes) - added by Woil on 10/04/07 17:40:56.
Fix this bug with one simple line

Change History

08/28/07 17:05:47 changed by mislav

  • status changed from new to closed.
  • resolution set to worksforme.
  • summary changed from Even.element fails on IE 6 to Event.element() fails on IE6.

I can't reproduce this. Can you confirm that the bug is definitely in Prototype? Can you paste the complete code for your minimal test case? Thank you

10/04/07 17:40:56 changed by Woil

  • attachment event_patch.patch added.

Fix this bug with one simple line

10/04/07 17:46:35 changed by Woil

  • status changed from closed to reopened.
  • resolution deleted.
  • summary changed from Event.element() fails on IE6 to [PATCH] Event.element() fails for keydown during refresh on IE6 and IE7.

The current release version 1.5.1.1 uses a test case to ensure that event.target exists, the current release candidate and edge versions do not. The issue occurs intermittently using IE7 under the following conditions:
1. Hook keydown on a document wide basis.
2. In your handler use Event.element(event)
3. Press F5 for refreshing the page

Sometimes the event doesn't have a target node, and sometimes it does. Keep the event.srcElement from version 1.5.1.1

It may fail for other reasons too, but this is how it failed for me.

-Woil

10/04/07 21:29:13 changed by Woil

Looking further at the code has left me even more confused. event.target always should work because it is being assigned to event.srcElement before the methods are extended. The only thing that I can figure is that the srcElement must not be assigned when the event is first extended, but is assigned when the Event.element method is called...

11/15/07 21:42:42 changed by Tobie

  • status changed from reopened to closed.
  • resolution set to untested.