-
Notifications
You must be signed in to change notification settings - Fork 104
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: Add 'Other' option for radio/checkbox questions. #1694
feat: Add 'Other' option for radio/checkbox questions. #1694
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1694 +/- ##
============================================
+ Coverage 40.05% 42.05% +1.99%
- Complexity 562 568 +6
============================================
Files 55 55
Lines 2379 2385 +6
============================================
+ Hits 953 1003 +50
+ Misses 1426 1382 -44 |
Hi @AIlkiv thanks for contributing :) I'll have a closer look at it in the next few days. In the meantime you could already go on and fix the errors from our check workflows. @nextcloud/designers what do you think about the implementation? I'd propose to remove the |
7f28f36
to
021de39
Compare
Fixed |
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 a closer look at your changes and left some comments. :-)
Thanks for the contribution @AIlkiv I think that this text field that is shown when other is selected should appear below the radio button and span the whole width of the container. Also I think it would be nice to see what these "other" results are in the answers page. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
021de39
to
a1536c4
Compare
@Chartman123 It looks like I fixed everything. |
@nextcloud/designers what do you think about this? I think it's still best to keep the input field below the radio. |
Very cool! I don't have a strong opinion on the placement of the field, we can show it below like @marcoambrosini said so that it's nicely left aligned with the rest of the options :) Rest of design looks great, some wording suggestions
|
|
Two more things:
@marcoambrosini If we just add the line break like in the screenshots above, I don't like the look as it moves the text higher than the checkbox next to it. So did you think of a completely new line with the left alignment like for a normal input field? In this case we could also limit the hover effect to just the checkbox and the "Other: " label. However, I don't think it's too problematic on mobile screens with the in-line field: (compared to the short answer field below) |
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.
@marcoambrosini In this version, in my opinion, there is no understanding that the radio button and the input field are one field. In Google Forms on mobile devices, it looks normal when everything is in one row. |
@marcoambrosini Your example has an additional label, making it appear well-structured. I attempted to break it into two lines, but it seems less intuitive to me (I see four options and a separate option to enter an answer). What are your thoughts? |
@AIlkiv could you try to align the text inside the input field with the text of the other options? And to make it more clear that they both belong together you could change the label to |
|
![]() Doing this would break things up visually, and it's not future-proof: If anything changes either in the Given that:
@AIlkiv I think it's fine if we have the inline option and only wrap it into one above the other below something like 500px. |
@marcoambrosini ok, you're right. 👍🏻 @AIlkiv you can use |
@Chartman123 I don't think we can use So what we really care about is the width of the container, but that's a bit hard to "watch". I suggest we put the button and input in a flexbox and give a |
26bcad5
to
c46ac20
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.
Very nice! Thank you 🎉
Looks good overall, I do not like the otherAnswer
name, but should be ok.
So, this good from my point :)
Do you have something better in mind? We could still change it before merging... |
Not really, I just think it is a bit misleading. It sounds like it is possible to have multiple different answers. |
@AIlkiv Before merging, could you please add the new prop to the docs at docs/API.md and docs/DataStrutcture.md? |
I modified the name to 'allowOtherAnswer' in the 'extraSettings'. |
Nice, please push the changes and add it to the api docs, then we can merge this :) |
8d9e495
to
14ece0a
Compare
@Chartman123 @susnux Finished |
@@ -402,4 +472,24 @@ export default { | |||
} | |||
} | |||
} | |||
|
|||
.question__other-answer::v-deep { |
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.
Is the deep sector required? If yes we should use :deep()
as v-deep id deprecated
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.
This is required for a single selector. Divided into parts with :deep() and without :deep().
@AIlkiv could you add a bigger margin, say 8px? |
14ece0a
to
ceac82f
Compare
@marcoambrosini Changed code and push |
Sorry @AIlkiv, without the checked feedback the input field looks too far from the label "Other", so could we dial back the margin to 4px. Thank you :) |
Signed-off-by: Andrii Ilkiv <a.ilkiv.ye@gmail.com>
ceac82f
to
da261ff
Compare
Ok, refreshed commit. |
Thanks a lot for your contributions @AIlkiv and @Chartman123 ❤️ |
I have implemented a feature to provide other answer for radio buttons and checkboxes.
Related to #93
Demo: