From e3664b1267eb465f606e55d937fb08c7a4fb83d3 Mon Sep 17 00:00:00 2001 From: Julian Dehm Date: Wed, 8 Jan 2025 15:20:06 +0100 Subject: [PATCH] fix other answer input field being disabled for unregistered users --- adhocracy4/polls/static/PollDetail/ChoiceRow.jsx | 4 ++-- adhocracy4/polls/static/PollDetail/PollChoice.jsx | 1 - changelog/_0002.md | 3 +++ 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 changelog/_0002.md diff --git a/adhocracy4/polls/static/PollDetail/ChoiceRow.jsx b/adhocracy4/polls/static/PollDetail/ChoiceRow.jsx index c3d65582a..4c861f564 100644 --- a/adhocracy4/polls/static/PollDetail/ChoiceRow.jsx +++ b/adhocracy4/polls/static/PollDetail/ChoiceRow.jsx @@ -34,7 +34,7 @@ export const ChoiceRow = React.memo(({ disabled, otherChoiceAnswer, onOtherChange, - isAuthenticated, + userAllowedVote, isReadOnly, errors }) => { @@ -88,7 +88,7 @@ export const ChoiceRow = React.memo(({ id={choice.id} value={textareaValue} // Always use the local state value onChange={handleTextareaChange} - disabled={!isAuthenticated || isReadOnly} + disabled={disabled} error={errors} /> )} diff --git a/adhocracy4/polls/static/PollDetail/PollChoice.jsx b/adhocracy4/polls/static/PollDetail/PollChoice.jsx index e79bc3669..f1889637a 100644 --- a/adhocracy4/polls/static/PollDetail/PollChoice.jsx +++ b/adhocracy4/polls/static/PollDetail/PollChoice.jsx @@ -84,7 +84,6 @@ export const PollChoice = (props) => { disabled={!userAllowedVote || props.question.isReadOnly} otherChoiceAnswer={otherChoiceAnswer} onOtherChange={handleOtherChange} - isAuthenticated={props.question.authenticated} isReadOnly={props.question.isReadOnly} errors={errors} /> diff --git a/changelog/_0002.md b/changelog/_0002.md new file mode 100644 index 000000000..4be0dce30 --- /dev/null +++ b/changelog/_0002.md @@ -0,0 +1,3 @@ +### Fixed + +- fixed other answer input field being disabled for unregistered users