olton / Metro-UI-CSS

Impressive component library for expressive web development! Build responsive projects on the web with the first front-end component library in Metro Style. And now there are even more opportunities every day!
http://metroui.org.ua/
MIT License
7k stars 1.97k forks source link

color-selector onSelectColor not fired #1908

Open FrancescoCarraro opened 1 year ago

FrancescoCarraro commented 1 year ago

When I select a color in color selector, no event is fired, so I don't know how to automatically process the color change

olton commented 1 year ago

Try updating Metro to the latest version.

FrancescoCarraro commented 1 year ago

Hi Serhii, thanks for answering. I don't think updating solve the issue: there's something I don't understand. Looking at the code of the component, I see that in both versions (the one I'm currently using at the last one) the following 2 lines of code are present in the 'ColorSelectorDefaultConfig':

onSelectColor: Metro.noop, onColorSelectorCreate: Metro.noop

I'm currently not able to find the definition of Metro.noop, anyway I guess it is a way not to define a function related to the event. Am I completely wrong?

Anyway I tried to associate a function to the event in my HTML:

But it is never fired.

So far, the only way to do what I need, is adding a button that use the val() method provided by the component to get the selected color. It is not my favorite solution (I would like to automatically do this by simply selecting a color and raising consequently an event) but could be ok for my purpose.

Best regards, Francesco

Da: Serhii Pimenov @.> Inviato: lunedì 19 giugno 2023 13:15 A: olton/Metro-UI-CSS @.> Cc: Francesco @.>; Author @.> Oggetto: Re: [olton/Metro-UI-CSS] color-selector onSelectColor not fired (Issue #1908)

Try updating Metro to the latest version.

- Reply to this email directly, view it on GitHubhttps://github.com/olton/Metro-UI-CSS/issues/1908#issuecomment-1596996731, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFCO3L6LMRVBFLVSPDP7XZTXMAYDFANCNFSM6AAAAAAZLYT36M. You are receiving this because you authored the thread.Message ID: @.**@.>>

olton commented 1 year ago

Check attribute data-on-select-color

FrancescoCarraro commented 1 year ago

This is really embarassing...... I used several times this way of writing events in HTML with your library but this time I didn't realize how I was wrong in this piece of HTML....thanks for your help!

Francesco

Da: Serhii Pimenov @.> Inviato: lunedì 19 giugno 2023 14:22 A: olton/Metro-UI-CSS @.> Cc: Francesco @.>; Author @.> Oggetto: Re: [olton/Metro-UI-CSS] color-selector onSelectColor not fired (Issue #1908)

Check attribute data-on-select-color

- Reply to this email directly, view it on GitHubhttps://github.com/olton/Metro-UI-CSS/issues/1908#issuecomment-1597091458, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFCO3L4MXWF4DMPT3Z7XTODXMBAALANCNFSM6AAAAAAZLYT36M. You are receiving this because you authored the thread.Message ID: @.**@.>>