Repository navigation
[EuiOutsideClickDetector] Migrate from class to function component - #9667
Conversation
|
👋 Since this is a community submitted pull request, a Buildkite build has not been started automatically. Would an Elastic organization member please verify the contents of this pull request and kick off a build manually? |
There was a problem hiding this comment.
Pull request overview
Migrates EuiOutsideClickDetector from a React class component to a function component, aligning it with modern hook-based patterns while preserving its outside-click detection behavior used by popovers and other overlays.
Changes:
- Replaced constructor-generated IDs with
useGeneratedHtmlId() - Replaced instance state (
capturedDownIds) with auseRefand moved document listener setup/teardown touseEffect - Refactored child event stamping/handling logic into local functions and continued cloning the single child element with injected handlers
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
💚 Build Succeeded
History
|
💚 Build SucceededHistory
|
weronikaolejniczak
left a comment
There was a problem hiding this comment.
I tested it, works well, CI is passing. The Copilot's comment about forwardRef is irrelevant, I checked Kibana and there are no cases of ref being passed to EuiOutsideClickDetector (this is a very simple component).
Thank you for contributing, we highly appreciate it! 🚀
Summary
API Changes
Screenshots
Impact Assessment
Note: Most PRs should be tested in Kibana to help gauge their Impact before merging.
Impact level: 🟢 None
Release Readiness
QA instructions for reviewer
Checklist before marking Ready for Review
Reviewer checklist