modular-forms
modular-forms copied to clipboard
Shouldn't `shouldActive` be `false` per default?
I feel like it's weird that it's implicitly true
.
What use case does this cover? Wouldn't people always be interested in retrieving a value they specified, whether or not it is active? I feel like that's 90% of use cases, and the shouldActive: true
one is maybe 10%.
But that's of course just a gut-feeling. Just curious about this, and if it should be changed in next version.
Have you read the info in the docs about this? Technically, of course, I can change the behavior. However, as a developer, you can already control the behavior through various properties and options. What problems are you encountering with the current approach? How do you currently solve these problems?
I should have clarified that what I mean is when using getValue
. When you want to get a value of a form, typically you want the value no matter if the element is attached to the DOM or not.
That part seemed counter-intuitive to me. And I think the API should reflect most use cases per default, not the other way around.
I did read the docs yes 😄
Don't get me wrong, I love the library, and I know the above is just my opinion. Just sharing it to start a (hopefully) constructive discussion around it.
It's your library, and your decision. I love it, and I appreciate the work you do.
Thank you very much for your feedback. I have received feedback on the active
state from time to time and understand that it sometimes leads to awkward problems. Maybe your idea is not so bad to set it to false
by default. I'll wait a bit and think about it.