Skip to content

Commit

Permalink
chore: limit height of multiple choice question (#1740)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasheriques authored Feb 15, 2025
1 parent 7b44832 commit a98818a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/extensions/surveys.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {

import * as Preact from 'preact'
import { useContext, useEffect, useMemo, useRef, useState } from 'preact/hooks'
import { addEventListener } from '../utils'
import { document as _document, window as _window } from '../utils/globals'
import { createLogger } from '../utils/logger'
import { isNull, isNumber } from '../utils/type-utils'
Expand All @@ -35,7 +36,6 @@ import {
style,
SurveyContext,
} from './surveys/surveys-utils'
import { addEventListener } from '../utils'
const logger = createLogger('[Surveys]')

// We cast the types here which is dangerous but protected by the top level generateSurveys call
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/surveys/components/QuestionTypes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export function MultipleChoiceQuestion({
forceDisableHtml={forceDisableHtml}
backgroundColor={appearance.backgroundColor}
/>
<div className="multiple-choice-options">
<div className="multiple-choice-options limit-height">
{/* Remove the last element from the choices, if hasOpenChoice is set */}
{/* shuffle all other options here if question.shuffleOptions is set */}
{/* Always ensure that the open ended choice is the last option */}
Expand Down
6 changes: 6 additions & 0 deletions src/extensions/surveys/surveys-utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ export const style = (appearance: SurveyAppearance | null) => {
background: ${appearance?.backgroundColor || '#eeeded'};
opacity: .60;
}
.limit-height {
max-height: 300px;
overflow: auto;
scrollbar-width: thin;
scrollbar-color: ${appearance?.borderColor || '#c9c6c6'} ${appearance?.backgroundColor || '#eeeded'};
}
.multiple-choice-options {
margin-top: 13px;
font-size: 14px;
Expand Down

0 comments on commit a98818a

Please sign in to comment.