-
-
Notifications
You must be signed in to change notification settings - Fork 170
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
Select field: remove undocumented empty prop #6459
Conversation
f0c6988
to
c679761
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautifully simple. After wrapping my head around the logic, it makes a lot of sense to me.
Co-authored-by: Lukas Bestle <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gets my approval backend-wise 👍
@lukasbestle I spotted that it can be simplified even further: So I removed the Also allows us to get rid of the local |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had written a comment asking about how the default
prop works at all, but then realized the backend does it, so I answered my own question. But I didn't realize that required fields only need the empty state before they are first set. That's a good point and simultaneously clears up that confusion I had for the future.
TBH I don't fully get why we needed that selected
attribute at all, but you know better why we don't need it anymore. If you are sure about the implementation, I think nothing speaks against merging the PR, otherwise someone else should review the frontend code.
@afbora would be great to get your review and tests here as well. Always good to be double safe with such changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and works great 👍
This PR …
Revives #3373. Presented breaking case inside structure fields works by now.
By now the empty prop is redundant. Everything can be replicated by required, default and placeholder props.
Enhancements
default
prop supports Kirby queries in radio and select fieldBreaking changes
empty
prop was removed. Use combination ofrequired
,placeholder
anddefault
to replicate functionality.For review team