elix/elix

Events(Tap,mousedown) Not triggered after moving from 7 to 12.

dinesh5k opened this issue · 4 comments

Hi There,

I have moved my code from Elix 7 to 12 and Tap event is not getting triggered on FilterListBox, I went thru lot of documentation and no solution yet. Could you please point me what I am doing wrong.

Sorry you're having trouble!

I'm not seeing the problem you describe in the current Elix 15.0.0 release. If I create a demo that wires up a mousedown handler and open the dev console, I see the mousedown events logged as expected.

Can you explain a bit more about what you're trying to do? It's possible that something was broken in Elix 12, but that's a pretty old version at this point.

Thank you for the reply.

I checked out your demo, my code is like this, the tap event is not triggered and I had to add my own code to trigger the tap.
Please let me know if you may have any suggestions.

class ExtendedFilterListBox extends FilterListBox {
get internal.defaultState {
return Object.assign(super[internal.defaultState], {
generic: false
});
}

//this is not triggered
[internal.tap](/** @type {MouseEvent} */ event) {
if (super[internal.tap]) {
superinternal.tap;
}
this._fireValueChanged();
}

[internal.render](/** @type {PlainObject} */ changed) {
if (super[internal.render]) {
superinternal.render;
}
if (changed.items) {
this._updateOddRows();
}
//this work around is picked up
this.addEventListener('click', (e) => {
this._fireValueChanged();
});

}
get internal.template {
const style = this.styles();
const result = super[internal.template];
result.content.append(
html<style> ${style} </style>
);
return result;
}

}

I figured out the issue, the internal import is missing Events, so I changed the import from core to base and things started working again.

Many thanks for the follow-up.