Metro-UI-CSS icon indicating copy to clipboard operation
Metro-UI-CSS copied to clipboard

color-selector onSelectColor not fired

Open FrancescoCarraro opened this issue 2 years ago • 4 comments

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

  • OS: Windows 11
  • Browser: edge
  • Metro Version: 4.4.3

FrancescoCarraro avatar Jun 19 '23 11:06 FrancescoCarraro

Try updating Metro to the latest version.

olton avatar Jun 19 '23 11:06 olton

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: @.@.>>

FrancescoCarraro avatar Jun 19 '23 12:06 FrancescoCarraro

Check attribute data-on-select-color

olton avatar Jun 19 '23 12:06 olton

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: @.@.>>

FrancescoCarraro avatar Jun 19 '23 12:06 FrancescoCarraro