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

Skipping null values from rendering #153

Merged
merged 1 commit into from
Nov 29, 2021
Merged

Conversation

sadikoff
Copy link
Contributor

Hi there!

This should fix a weird situation when we are rendering stringified null value attribute and stimulus using null string as a value instead of just skipping it.

@weaverryan
Copy link
Member

Thanks for this @sadikoff!

To be fully clear, if you passed a true null to stimulus_controller() for a value that is a String type in your Stimulus controller, then:

Before this change: The value would be the string null (literally those 4 charaters) in JavaScript.
After this change: The value will be '' empty quotes. It still won't be a true null in your controller, but that's just because Stimulus expects the type to be a String always, so it gives you a astring.

weaverryan added a commit that referenced this pull request Nov 29, 2021
This PR was squashed before being merged into the main branch.

Discussion
----------

Adding a test for null value case

Test case for #153

Commits
-------

b03b0ba Adding a test for null value case
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.

2 participants