-
Notifications
You must be signed in to change notification settings - Fork 91
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
feat(NcActionButton): support boolean value for radio type #5134
Conversation
@juliushaertl Am I right that in |
That sounds like a sane addition. One thing I'm unsure about is switching to radio buttons in text give then current behaviour that you can toggle for example a heading style by clicking again on it. That doesn't seem like something a radio button would usually handle (unless there is an additional radio state for the paragraph style for example) |
I'm not sure, I understand where I can find this behavior... When I click on the "Heading" menu button, it always only opens the menu and doesn't change the styles, until I select the heading level. And for disabling heading, I need to click on the selected heading. But I realised now that click on selected radio button should probably disable the the selected item |
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
e970ffc
to
68fe201
Compare
Yes, that is what I was referring to, toggling the radio state on the actual menu entries. |
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.
Might lead to situations where multiple radio buttons are active on the same time, but thats even possible now. So good for me, I like the feature!
Yes, but the same with native We probably may add some automatic grouping in future:
|
🏃♂️ Short description
Allows to have checkbox-like usage for developers having radio semantics for users.
☑️ Resolves
Currently
NcActionButton[type="radio"]
supports only stringmodelValue
based onvalue
value. For example, if we have alignment, we can use the button with one string variable withleft | center | right
value.It is great in a general case. But sometimes it is more convenient to define
boolean
check value for each button. For example, intext
, where the value is more complex like['heading', { level: 1 }]
and is managed byTiptop
.Imagine, we have such a data structure and update method. So we want to define the checked state for each button as it is, not by value.
This PR introduces such a feature, based on
modelValue
type.🖼️ Screenshots
🏁 Checklist