-
Notifications
You must be signed in to change notification settings - Fork 253
fix : doc view crashing when selecting enum value #2859
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 : doc view crashing when selecting enum value #2859
Conversation
✅ Deploy Preview for stoplight-elements-demo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for stoplight-elements ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
prafullaAtSB
left a comment
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.
looks common code of encodeSafeSelectorValue method here and at packages/elements-core/src/components/TryIt/Servers/VariableEditor.tsx
create utility class and use it at both place.
|
@prafullaAtSB , I have removed the redundant code. |
prafullaAtSB
left a comment
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.
Changes looks good to go ahead after comments incorporating..
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.
The fix looks ok to stabilise the view to avoid crash.
Although the spec is not appropriate constructed as per the guidelines.
…query-parameter-try-request
bhaskarsontakke
left a comment
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.
LGTM !
Motivation and Context
STOP-4423
Description
Elements crash when user tries to apply query parameter to try request with enum value & example.
The error originated from React Aria (which Mosaic uses internally), but the root cause was that Elements was passing unencoded values with special characters to Mosaic's Select component.
Mosaic's Select component is a generic UI component that shouldn't need to know about encoding/sanitizing data values.
By encoding values in Elements before passing them to Mosaic Select, we've ensured the values are CSS-selector-safe.
How Has This Been Tested?
Verified on PR environment by publishing Elements alpha version first. - https://x-20657.stoplight-dev.com
Screenshot(s)/recordings(s)
Before -

After

Types of changes
Checklist
s/needs-docslabel.