Skip to content

Prevent style attribute to be equal to ' null' string #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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bijela-gora
Copy link

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
Author

@janosh hi! This PR is ready for review.

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

Successfully merging this pull request may close these issues.

1 participant