fix: doc-explorer search combobox null checks
This PR adds a null check to fix a bug in the doc explorer that happens when the search field loses focus when there is no text in the search input. To reproduce in the Graphiql live demo:
- Open the browser console
- Open the Documentation Explorer (upper left)
- Start searching in the pane
- Delete your search term and click away from the search bar
- See the console log this error:
Uncaught TypeError: right-hand side of 'in' should be an object, got null
The cause: The headlessui combobox is nullable by default in ^2, a change in api from ^1 Our existing onChange handler does not expect null values to be passed
The fix: Add an early null check to the onChange handler
🦋 Changeset detected
Latest commit: 6a8d630195e6edd2aa65a20d4358ccd2aeac13f7
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @graphiql/plugin-doc-explorer | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
- :x: - login: @LBPeterson / name: Luke B. Peterson . The commit (8bc509e8b646e3494b05e5310e82f4edcbd2710d, 6a8d630195e6edd2aa65a20d4358ccd2aeac13f7) is not authorized under a signed CLA. Please click here to be authorized. For further assistance with EasyCLA, please submit a support request ticket.
closing due missing CLA
this issue will be fixed in the upcoming GraphiQL 5, which will be released tomorrow https://github.com/graphql/graphiql/pull/4030