angular-redux / form

Keep your Angular2+ form state in Redux
MIT License
41 stars 15 forks source link

form component value being set to empty string (on a boolean) on initial form load #62

Closed aurimas-darguzis closed 5 years ago

aurimas-darguzis commented 6 years ago

This is a...

What toolchain are you using for transpilation/bundling?

Environment

NodeJS Version: 8.11.1 Typescript Version: 2.3.4 Angular Version: 5.2.9 @angular-redux/store version: 7.1.1 @angular/cli version: (if applicable) 1.2.6 OS: mac

Link to repo showing the issus

(optional, but helps a lot)

Expected Behaviour:

Reflect the value from redux store in the form template without changing the value on initial component load.

Actual Behaviour:

When the form loads, there is a property in redux store that has initial value of 'false', but when the component is initiated, I can inspect in redux tools, that @@angular-redux/form/FORM_CHANGED changes the value to empty string. It is a checkbox component. When I try to manually switch in on/off, the correct value is being sent to the server. Any ideas why is that happening?

Stack Trace/Error Message:

n/a

Additional Notes:

Please let me know if you need any other info about the issue

smithad15 commented 6 years ago

I have setup a checkbox input with an initial store value of false and am unable to replicate this. Can you provide a sample repo/project that shows the issue you are having?

aurimas-darguzis commented 5 years ago

Hi,

thank you for you response. I was able to fix this issue. It was related to other component that was interacting with the library.