You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When referencing a ColorPicker instance, we can call the el method on the object to get the HTML element that the color picker was mounted to. When we add callbacks to the color picker, for example color:change or input:end, we are passed a Color instance, that has properties describing the current color state of the picker.
My question however, is whether it is possible to determine within the callback function which ColorPicker this Color object corresponds to? The end goal being to grab some data-* attributes from the HTML element the color picker was mounted to in order to perform some action that is specific to this color picker (as opposed to other color pickers which may be rendered on the same page). Can this be done? I can't find a way to reference the element or ColorPicker instance from the Color instance, and don't see it listed in the Colors API, but it seems that this would be a common use case, so perhaps I am missing something.
Thanks!
The text was updated successfully, but these errors were encountered:
When referencing a ColorPicker instance, we can call the el method on the object to get the HTML element that the color picker was mounted to. When we add callbacks to the color picker, for example color:change or input:end, we are passed a Color instance, that has properties describing the current color state of the picker.
My question however, is whether it is possible to determine within the callback function which ColorPicker this Color object corresponds to? The end goal being to grab some data-* attributes from the HTML element the color picker was mounted to in order to perform some action that is specific to this color picker (as opposed to other color pickers which may be rendered on the same page). Can this be done? I can't find a way to reference the element or ColorPicker instance from the Color instance, and don't see it listed in the Colors API, but it seems that this would be a common use case, so perhaps I am missing something.
Thanks!
The text was updated successfully, but these errors were encountered: