-
Notifications
You must be signed in to change notification settings - Fork 160
fix: style problems in multiple/single-choice questions #2016
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
PR Summary
This PR improves survey UI and component architecture in posthog-js by addressing multiple layout and functionality issues:
- Fixed unwanted line breaks in multiple/single choice survey options by adding
flex-shrink: 0
and movingflex-wrap
to open choice options only - Improved open text question autofocus by moving logic from
usePopupVisibility
hook directly intoOpenTextQuestion
component, making it work reliably for non-first questions - Refactored CSS organization in
survey.css
andsurveys-extension-utils.tsx
by grouping non-customizable variables together and removing duplicate transition definitions - Fixed survey bottom border logic in
surveys-extension-utils.tsx
by making the condition more explicit with better variable naming
4 files reviewed, no comments
Edit PR Review Bot Settings | Greptile
Size Change: +3.51 kB (+0.1%) Total Size: 3.56 MB
ℹ️ View Unchanged
|
src/extensions/surveys/survey.css
Outdated
& span { | ||
color: inherit; | ||
} |
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 fixes second first problem (white text color on the white background)
src/extensions/surveys/survey.css
Outdated
&.choice-option-open { | ||
flex-wrap: wrap; | ||
} |
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.
and this fixes the line-break problem, by only wrapping if it's an open-ended input
useEffect(() => { | ||
setTimeout(() => { | ||
inputRef.current?.focus() | ||
}, 100) | ||
}, []) |
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.
logic to autofocus on the open question input moved to here, where it makes more sense.
c9ec269
to
3b03134
Compare
d826c2d
to
240fa0e
Compare
Changes
This PR fixes two main problems.
First one, it prevents this line break from happening:
Second, it makes sure the label of the checkboxes/radio inputs has the proper, contrasted color:
Other misc changes
Checklist