Skip to content

Prevent empty style attributes on ul.selected > li and ul.options > li #304

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

Merged
merged 4 commits into from
May 15, 2025

Conversation

bijela-gora
Copy link
Contributor

Hi,

Thank you for the excellent UI component. It works perfectly for my use case.

Reason for this PR

When I added the style-src-attr 'none' directive to the Content-Security-Policy response header, I noticed the component stopped functioning. This issue occurred because the style=" null" attribute was being added to the li option element.

Summary of changes

This fix ensures that an invalid value, " null", is not assigned to the style attribute of the element when liSelectedStyle, or liOptionStyle, or the {style: { option: string; selected: string }} object is not passed.

Checklist

[x] Tests are included.

@bijela-gora
Copy link
Contributor Author

@janosh hi! This PR is ready for review.

@janosh janosh added dx Developer experience tests Test all the things labels May 15, 2025
@janosh janosh changed the title Prevent style attribute to be equal to ' null' string Prevent empty style attributes on ul.selected > li and ul.options > li May 15, 2025
@janosh janosh merged commit 83f9850 into janosh:main May 15, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dx Developer experience tests Test all the things
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants