fix: Prevent TypeError in downshift on iOS Safari#3999
Conversation
Bundle ReportChanges will increase total bundle size by 807 bytes (0.01%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: gazebo-production-systemAssets Changed:
Files in
Files in
view changes for bundle: gazebo-production-esmAssets Changed:
Files in
Files in
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3999 +/- ##
==========================================
- Coverage 98.73% 98.72% -0.02%
==========================================
Files 827 828 +1
Lines 15133 15148 +15
Branches 4357 4361 +4
==========================================
+ Hits 14942 14955 +13
- Misses 184 186 +2
Partials 7 7
Continue to review full report in Codecov by Harness.
|
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
@@ Coverage Diff @@
## main #3999 +/- ##
==========================================
- Coverage 98.73% 98.72% -0.02%
==========================================
Files 827 828 +1
Lines 15133 15148 +15
Branches 4357 4369 +12
==========================================
+ Hits 14942 14955 +13
- Misses 184 186 +2
Partials 7 7
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #3999 +/- ##
==========================================
- Coverage 98.73% 98.72% -0.02%
==========================================
Files 827 828 +1
Lines 15133 15148 +15
Branches 4365 4369 +4
==========================================
+ Hits 14942 14955 +13
- Misses 184 186 +2
Partials 7 7
Continue to review full report in Codecov by Sentry.
|
✅ Deploy preview for gazebo ready!Previews expire after 1 month automatically.
|
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #3999 +/- ##
==========================================
- Coverage 98.73% 98.72% -0.02%
==========================================
Files 827 828 +1
Lines 15133 15148 +15
Branches 4357 4369 +12
==========================================
+ Hits 14942 14955 +13
- Misses 184 186 +2
Partials 7 7
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Description
This PR addresses GAZEBO-17ZR, a
TypeError: null is not an object (evaluating 'e.body.appendChild')occurring in thedownshiftlibrary.The root cause was identified as
downshift's debounced accessibility status update (updateA11yStatus) attempting to accessdocument.body.appendChildafter a component has unmounted, specifically on iOS Safari during SPA navigation wheredocument.bodycan be temporarily null.Code Example
Notable Changes
To fix the
TypeError, a new hookuseDownshiftEnvironmentwas created. This hook provides a customenvironmentobject todownshift'suseComboboxhook. This custom environment proxieswindow.document.bodyto return a null-safe object with no-opappendChildandremoveChildmethods whendocument.bodyis null. This prevents theTypeErrorwithout affecting accessibility functionality under normal conditions.The
useDownshiftEnvironmenthook has been integrated into bothsrc/ui/MultiSelect/MultiSelect.jsxandsrc/ui/Select/Select.jsxcomponents, which utilizedownshift.Screenshots
Link to Sample Entry
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
Fixes GAZEBO-17ZR