Skip to content
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

fix(surveys): #23937 disables interactivity on templates, fixes click targets #24420

Merged
merged 7 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions frontend/src/scenes/surveys/SurveyTemplates.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@
border-color: var(--primary-3000-hover);
}

&:focus {
border-color: var(--primary-3000-hover);
outline: none;
}

.SurveyTemplate {
pointer-events: none;
transform: scale(0.8, 0.8);
}
}
33 changes: 19 additions & 14 deletions frontend/src/scenes/surveys/SurveyTemplates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,31 @@ export function SurveyTemplates(): JSX.Element {
<div className="flex flex-row flex-wrap gap-8 mt-8">
{defaultSurveyTemplates.map((template, idx) => {
return (
<div
className="flex flex-col items-center"
data-attr="survey-template"
key={idx}
onClick={() => {
setSurveyTemplateValues({
name: template.templateType,
questions: template.questions,
appearance: { ...defaultSurveyAppearance, ...template.appearance },
})
reportSurveyTemplateClicked(template.templateType)
}}
>
<div className="flex flex-col items-center" key={idx}>
<span className="text-md">
<b>{template.templateType}</b>
</span>
<span className="flex flex-wrap text-xs text-muted max-w-80 font-medium mb-3">
{template.description}
</span>
<div className="SurveyTemplateContainer">
<div
className="SurveyTemplateContainer"
tabIndex={idx + 1}
data-attr="survey-template"
onClick={() => {
setSurveyTemplateValues({
name: template.templateType,
questions: template.questions,
appearance: { ...defaultSurveyAppearance, ...template.appearance },
})
reportSurveyTemplateClicked(template.templateType)
}}
onKeyDown={(event) => {
if (event.key === 'Enter') {
event.currentTarget.click()
}
}}
>
<div className="SurveyTemplate">
<SurveyAppearancePreview
key={idx}
Expand Down
Loading