naja-js/naja

Respect preset unique

Closed this issue · 2 comments

I think that should be better to have check if unique is not set already. Because there is no possibility to force unique group or disable directly from JS. Or do i missing something?

https://github.com/naja-js/naja/blob/main/src/extensions/UniqueExtension.ts#L23

Hi, yes, nice catch, thanks! Other components of Naja only overwrite their respective option if the element has an explicit attribute. It seems it's omitted in this extension by mistake.

Would you care to send a PR? It should suffice to wrap the code in a similar condition to the one in AbortExtension. I'll put it in my backlog otherwise :)

What about this solution?