Ticket #2531106 (accepted enhancement)

Reporter


Jenny Donnelly
Opened: 09/16/11
Last modified: 04/15/13
Status: accepted
Type: enhancement

Owner


Luke Smith
Target Release: BACKLOG
Priority: P3 (normal)
Summary: [bz 4833809] Delegate change event is not firing in IE
Description:

Delegate change event is not firing in IE7 & IE8

Ex:
Y.delegate('change', function(){
alert("change event is fired.."); // Never comes here in IE
}, document.body,'input select');

<div>
<input type="text" />
<select>
<option>1</option><option>2</option>
</select>
</div>

Type: enhancement Observed in Version: 3.4.0
Component: Event Severity: S3 (normal)
Assigned To: Luke Smith Target Release: BACKLOG
Location: Library Code Priority: P3 (normal)
Tags: Relates To:
Browsers: IE 6.x,IE 7.x,IE 8.x
URL:
Test Information:

Change History

Luke Smith

YUI Contributor

  • Username: lsmith
  • GitHub: lsmith
Posted: 09/17/11
  • browser changed from IE 7.x,IE 8.x to IE 6.x,IE 7.x,IE 8.x
  • estimated changed from 0 to 1
  • remaining changed from 0 to 1
  • status changed from new to accepted
  • version changed from development master to 3.4.0

Luke Smith

YUI Contributor

  • Username: lsmith
  • GitHub: lsmith
Posted: 09/17/11

The simplest workaround for this issue is to place individual change event subscriptions on the select elements. Hopefully, the content areas that house the selects aren't being modified frequently, requiring manual addition and removal of subscriptions.

If delegation is absolutely required, a close facsimile to a change event can be calculated by delegating the click, focus, blur, and keydown events. On focus, store the current value somewhere. On click or blur or keydown with keyCode === 13, check the current value against the stored value. This of course is only necessary in IE.

J. Shirley

YUI Contributor

Posted: 10/12/11

I noticed this is also not working for input[type=file] fields. I did not see a ticket for that, could that be lumped in here or should a new ticket be filed?

Iliyan Peychev

YUI Contributor

Posted: 11/22/11

Hey Luke,

We implemented this feature in AlloyUI. The code is [here]:

If you are interested, we can contribute it to YUI.

Please, let me know.

Luke Smith

YUI Contributor

  • Username: lsmith
  • GitHub: lsmith
Posted: 11/23/11

Ticket #2528683 was marked as a duplicate of this ticket.

Luke Smith

YUI Contributor

  • Username: lsmith
  • GitHub: lsmith
Posted: 11/23/11

Ticket #2526038 was marked as a duplicate of this ticket.

Luke Smith

YUI Contributor

  • Username: lsmith
  • GitHub: lsmith
Posted: 01/30/12
  • sprint changed to sprint 3

Iliyan,
Thanks! I scanned over the implementation a couple weeks ago and aside from some implementation details, I'd love to have you contribute this. I'll have some time in February to work with you on this.

There is an outside chance that DataTable development will consume more of my time in sprint 3 than I want, and that may compromise the time needed for proper review, documentation, and testing. Have you pushed this to gallery?

Iliyan Peychev

YUI Contributor

Posted: 02/1/12

Cool, it would be really good to have it in YUI.

Meanwhile here is support for [submit event].

Do we have ticket for this one too?

No, I haven't published these in Gallery. They were created for AlloyUI library, but we decided to offer you them as contributions and I can create patches against current YUI3 trunk.

Iliyan Peychev

YUI Contributor

Posted: 02/1/12

Luke Smith

YUI Contributor

  • Username: lsmith
  • GitHub: lsmith
Posted: 03/2/12

DataTable development did indeed take longer than expected, but I still have today, if you're around. I'll look over the code again, but did you want me to just copy the code into master or will you issue a pull request?

Iliyan Peychev

YUI Contributor

Posted: 03/2/12

Well, I would prefer to send you two pull requests - one about delegate change and other about delegate submit events (https://github.com/natecavanaugh/alloy-ui/blob/master/src/aui-event/js/aui-event-delegate-submit.js).
I can't do this today, but I can do it soon and you will be able to review them when you have time. Is this OK for you?

Luke Smith

YUI Contributor

  • Username: lsmith
  • GitHub: lsmith
Posted: 03/2/12

Unfortunately, code freeze for 3.5.0pr3 (which, for new development, is effectively code freeze for 3.5.0 GA) is today. There are enough changes from the AUI code that I'd end up reorganizing a fair bit of it, anyway, so I'll just write the module and add an attribution comment.

Sorry my schedule compromised the pull request timing. It's certainly easier to give credit via git log than attribution.

Luke Smith

YUI Contributor

  • Username: lsmith
  • GitHub: lsmith
Posted: 03/4/12
  • completed changed from 0 to .75
  • remaining changed from 1 to .25

It's looking like this may slip out of pr3. I'm running into issues with radios and guaranteeing callbacks execute in subscriber order when there are mixed subs on() and delegate().

If you want to go ahead with the pull requests for both of these, please do. There will be iteration over the code, but we can discuss that in the github comments on the pull requests themselves.

Iliyan Peychev

YUI Contributor

Posted: 03/4/12

Sure, I will.

I'm aware of the issue with mixed subs on() and delegate(). I resolved it in the other event - those about delegating submit event, but I'm not fully satisfied with the solution. Basically, I think we have to check YUI3 code in order to provide cleaner solution. Please see this comment:
[http://yuilibrary.com/forum/viewtopic.php?p=30130#p30130]
and the next one in the thread ([http://yuilibrary.com/forum/viewtopic.php?p=30202#p30202]).

So, let's do it in this way - I will send you pull request and we can discuss which is the better way to resolve the issue and what exactly should we change in YUI3 code. I have an idea and I will write it later. And once we find the right approach, we will apply it for the other event.

Thanks Luke!

Luke Smith

YUI Contributor

  • Username: lsmith
  • GitHub: lsmith
Posted: 03/6/12

My plan that didn't pan out for pr3 was to base the change synth on the approach used by the focus synth, which addresses on() and delegate() sub execution order. Take a look at https://github.com/yui/yui3/blob/master/src/event/js/focusblur.js - it's lengthy, but it seems to do the right thing.

Luke Smith

YUI Contributor

  • Username: lsmith
  • GitHub: lsmith
Posted: 03/24/12
  • milestone changed from 3.5.0 to 3.6.0

Luke Smith

YUI Contributor

  • Username: lsmith
  • GitHub: lsmith
Posted: 04/2/12

Ticket #2532095 was marked as a duplicate of this ticket.

Luke Smith

YUI Contributor

  • Username: lsmith
  • GitHub: lsmith
Posted: 04/5/12
  • sprint changed from sprint 3 to backlog

Jenny Donnelly

YUI Developer

  • Username: jenny
  • GitHub: jenny
Posted: 07/24/12
  • milestone changed from 3.6.0 to 3.NEXT

Moving from 3.6.0 backlog to 3.NEXT.

Jenny Donnelly

YUI Developer

  • Username: jenny
  • GitHub: jenny
Posted: 09/19/12
  • milestone changed from 3.NEXT to BACKLOG

Moving from 3.NEXT to BACKLOG.

Andrew Wooldridge

Posted: 11/2/12

Iliyan, I wanted to follow up with you on this bug because this would be a great feature to add to YUI. I don't want this to get lost in the course of time and wanted to know if you are interested in working further on it to get it into YUI. If you have the bandwidth, I'll make sure we can get you the support you need to get it ready to pull in. Interested?

Iliyan Peychev

YUI Contributor

Posted: 11/5/12

Yeah, I am.

Alberto Gragera Cerrajero

YUI Contributor

  • Username: albgra
  • GitHub: albgra
Posted: 11/15/12

Hey guys,

Is there any roadmap for this and the submit event delegation support?

Thanks!

Iliyan Peychev

YUI Contributor

Posted: 11/18/12

Not yet, I'm still waiting for Andrew. Maybe he was busy because of the YUI Conf.

Andrew Wooldridge

Posted: 12/18/12

Hi Iliyan, I apologize for the long delay, I failed to cc myself to this bug so I did not see your updates. The next steps for this would be for you to issue the pull requests you planned and we can kick off the discussion in that forum - getting feedback from developers involved, and basically move things forward.

Iliyan Peychev

YUI Contributor

Posted: 12/21/12

Hi Andrew,

Sounds good, I will prepare and shoot a PR soon.

Iliyan Peychev

YUI Contributor

Posted: 12/30/12

Andrew Wooldridge

Posted: 01/2/13

Thanks for submitting that! I'll follow up with Dav once he's had a chance to look at it.

Jenny Donnelly

YUI Developer

  • Username: jenny
  • GitHub: jenny
Posted: 04/15/13

Iliyan's PR is still in progress.