Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy attributes from original select #19

Closed
ghost opened this issue Nov 20, 2020 · 4 comments
Closed

copy attributes from original select #19

ghost opened this issue Nov 20, 2020 · 4 comments

Comments

@ghost
Copy link

ghost commented Nov 20, 2020

Would it be possible to copy all attributes from the original select options to the new one, for example. If I have added data-color="#ff0000" to an option in the original select, I would like to see that value copied to the cloned select option. It would be nice if not only data-attr would be copied but any kind of attribute in the option html.

@PhilippeMarcMeyer
Copy link
Owner

Done ! it's v 0.55
Thanks for that ecellent idea !!!

@ghost
Copy link
Author

ghost commented Nov 23, 2020

GREAT!!! It might be a good option to put the text inside the LI into a span, giving it more options for adding custom styling

@PhilippeMarcMeyer
Copy link
Owner

PhilippeMarcMeyer commented Nov 23, 2020 via email

@ghost
Copy link
Author

ghost commented Nov 23, 2020

Hi Phillippe, I mean that it would be great to have the cloned dropdown filled with a span.

This is the code that is generated now:
<li data-value="all" data-text="Select All" value="all" class="active" data-selected="true">Clear All</li>

I would suggest putting the text in a span, the generated html would be like:
<li data-value="all" data-text="Select All" value="all" class="active" data-selected="true"><span>Clear All</span></li>

This way there are more option for styling because you can use the li:before and li:after but also li > span:before and li > span:after

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant