Skip to content

Conversation

@SB-virendrasolanke
Copy link
Contributor

@SB-virendrasolanke SB-virendrasolanke commented Dec 18, 2025

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 -
Screenshot 2026-01-14 at 4 08 56 PM

After
Screenshot 2026-01-14 at 3 18 29 PM

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • This PR's code follows as closely as possible the coding style/guidelines of this project.
  • I have added error reporting and followed the error reporting guidelines.
  • I have added event tracking and followed the event tracking guidelines.
  • I have updated any internal docs to reflect this PR's changes.
  • If this PR affects existing features or includes UI changes, I have reached out to the Tech Writers team OR added the s/needs-docs label.
  • I have added automated tests (unit/integration/e2e/other) to cover my changes.
  • All new and existing tests pass locally (excluding flaky CI tests).
  • If this PR completes a story or makes a substantial UX change, demo it to the Product Manager.

@netlify
Copy link

netlify bot commented Dec 18, 2025

Deploy Preview for stoplight-elements-demo ready!

Name Link
🔨 Latest commit 57c6ac5
🔍 Latest deploy log https://app.netlify.com/projects/stoplight-elements-demo/deploys/69679bfbada6360007114613
😎 Deploy Preview https://deploy-preview-2859--stoplight-elements-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Dec 18, 2025

Deploy Preview for stoplight-elements ready!

Name Link
🔨 Latest commit 57c6ac5
🔍 Latest deploy log https://app.netlify.com/projects/stoplight-elements/deploys/69679bfb6301210008f43a0c
😎 Deploy Preview https://deploy-preview-2859--stoplight-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@prafullaAtSB prafullaAtSB left a 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.

@SB-virendrasolanke
Copy link
Contributor Author

@prafullaAtSB , I have removed the redundant code.

Copy link
Contributor

@prafullaAtSB prafullaAtSB left a 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..

Copy link
Contributor

@prafullaAtSB prafullaAtSB left a 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.

Copy link

@bhaskarsontakke bhaskarsontakke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

@SB-virendrasolanke SB-virendrasolanke changed the title Doc View Crashing when selecting Enum value fix : doc view crashing when selecting enum value Jan 16, 2026
@SB-virendrasolanke SB-virendrasolanke merged commit 5f922bf into main Jan 16, 2026
8 checks passed
@SB-virendrasolanke SB-virendrasolanke deleted the stop-4423-query-parameter-try-request branch January 16, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants