Skip to content

Add adjust label hook for radio and checkbox (#1398) #1404

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

Open
wants to merge 4 commits into
base: 2.3.3
Choose a base branch
from

Conversation

jochenklar
Copy link
Member

No description provided.

@jochenklar jochenklar added this to the 2.3.3 milestone Aug 4, 2025
@jochenklar jochenklar requested a review from MyPyDavid August 4, 2025 12:15
@jochenklar jochenklar self-assigned this Aug 4, 2025
@MyPyDavid
Copy link
Member

the padding of the buttons seems good, but what about the overflow for really long texts? 🙃

image

@MyPyDavid
Copy link
Member

MyPyDavid commented Aug 6, 2025

when I go in the test Catalog to Options>Radio it breaks (independent of text).
The question in Collections>Radio buttons works fine.

Uncaught TypeError: can't access property "style", label is null
    useAdjustLabel webpack://rdmo/./rdmo/projects/assets/js/interview/hooks/useAdjustLabel.js?:17
    React 16
    Redux 3
    batchedUpdates$1 React
    Redux 7
    fetchValues webpack://rdmo/./rdmo/projects/assets/js/interview/actions/interviewActions.js?:235
    promise callback*fetchValues/< webpack://rdmo/./rdmo/projects/assets/js/interview/actions/interviewActions.js?:231
    Redux 2
    fetchPage webpack://rdmo/./rdmo/projects/assets/js/interview/actions/interviewActions.js?:119
    promise callback*fetchPage/< webpack://rdmo/./rdmo/projects/assets/js/interview/actions/interviewActions.js?:115
    Redux 2
    onClick webpack://rdmo/./rdmo/projects/assets/js/interview/components/sidebar/Navigation.js?:49
    handleClick webpack://rdmo/./rdmo/projects/assets/js/interview/components/sidebar/NavigationLink.js?:18
    React 23
    <anonymous> webpack://rdmo/./rdmo/projects/assets/js/interview.js?:27
    js http://localhost:8000/static/projects/js/interview.js:6115
    __webpack_require__ http://localhost:8000/static/projects/js/interview.js:7228
    <anonymous> http://localhost:8000/static/projects/js/interview.js:7304
    <anonymous> http://localhost:8000/static/projects/js/interview.js:7307
interview.js line 7050 > eval:17:7
The above error occurred in the <RadioInput> component:

RadioInput@webpack://rdmo/./rdmo/projects/assets/js/interview/components/main/widget/RadioInput.js?:34:18
div
div
RadioWidget@webpack://rdmo/./rdmo/projects/assets/js/interview/components/main/widget/RadioWidget.js?:34:14
QuestionWidget@webpack://rdmo/./rdmo/projects/assets/js/interview/components/main/question/QuestionWidget.js?:31:11
div
Question@webpack://rdmo/./rdmo/projects/assets/js/interview/components/main/question/Question.js?:32:16
div
div
Page@webpack://rdmo/./rdmo/projects/assets/js/interview/components/main/page/Page.js?:30:16
div
Main@webpack://r

@jochenklar
Copy link
Member Author

Hi @MyPyDavid , thanks for testing. I think we should not try to fix the non breaking of the long word, we will change to a flexbox layout eventually (with Bootstrap 5.3). I don't think it will happen in real live (maybe on very small phones). The other problem (and more) should be fixed with the last commit.

Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
@MyPyDavid
Copy link
Member

MyPyDavid commented Aug 7, 2025

with using the useState for the additional input I think I've fixed this error from occurring.

  • when typing normal and checking the checkbox just before the autosave leads to STORE_VALUE_ERROR

XHRPOST
http://localhost:8000/api/v1/projects/projects/18/values/
[HTTP/1.1 400 Bad Request 115ms]

conflict [ "An existing value for this attribute/set_prefix/set_index/collection_index was found." ]

btw. the state could also make the additional input re-appear again after unchecking/checking but I've cleared it for now.

Copy link
Member

@MyPyDavid MyPyDavid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks looks good to me! I've added the small change with the useState for additional input.

@MyPyDavid
Copy link
Member

so useState should not be used here? Instead clicking of the checkbox and the additional input could be coupled somewhere in the reducers somehow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants