-
Notifications
You must be signed in to change notification settings - Fork 577
Fix overlay spotlight #1156
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
base: main
Are you sure you want to change the base?
Fix overlay spotlight #1156
Conversation
Refactor `hideSpotlight` function in `src/components/Overlay.tsx`. * Remove `continuous` from the destructured props. * Define `hiddenLifecycles` array with `LIFECYCLE.BEACON`, `LIFECYCLE.COMPLETE`, and `LIFECYCLE.ERROR`. * Return true if `disableOverlay` is true or if `lifecycle` is in `hiddenLifecycles` array. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/maoryadin/react-joyride?shareId=XXXX-XXXX-XXXX-XXXX).
Refactor hideSpotlight function
Update `hideSpotlight` function and `componentWillUnmount` method in `src/components/Overlay.tsx`. * Add `continuous` to the destructured props in the `hideSpotlight` function. * Update the `hiddenLifecycles` array to include `LIFECYCLE.BEACON`, `LIFECYCLE.COMPLETE`, and `LIFECYCLE.ERROR`. * Update the `shouldHide` variable to account for the `continuous` property. * Update the `hideSpotlight` function to return `shouldHide`. * Add state reset for `mouseOverSpotlight` to `componentWillUnmount` method. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/maoryadin/react-joyride?shareId=XXXX-XXXX-XXXX-XXXX).
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
…lifecycle changes in componentDidUpdate Refactor `componentDidUpdate` method in `src/components/Overlay.tsx` to handle `spotlightClicks`, `disableOverlay`, and `lifecycle` changes. * Add logic to remove `mousemove` event listener and reset `mouseOverSpotlight` state when `spotlightClicks` or `lifecycle` changes. * Add logic to add `mousemove` event listener when `spotlightClicks` is true and `lifecycle` is `LIFECYCLE.TOOLTIP`. * Remove redundant `mousemove` event listener removal logic. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/maoryadin/react-joyride?shareId=XXXX-XXXX-XXXX-XXXX).
Fix overlay component to handle spotlightClicks, disableOverlay, and lifecycle changes in componentDidUpdate
Hey @maoryadin Did you try the pre-release version?
Do you still have the problem with it? |
Yes, the pre-release version does not fix the issues I resolved in my PR. I could use a forked version of the release, but I thought it would be nice to make it available for everyone. |
Update
hideSpotlight
function andcomponentWillUnmount
method insrc/components/Overlay.tsx
.continuous
to the destructured props in thehideSpotlight
function.hiddenLifecycles
array to includeLIFECYCLE.BEACON
,LIFECYCLE.COMPLETE
, andLIFECYCLE.ERROR
.shouldHide
variable to account for thecontinuous
property.hideSpotlight
function to returnshouldHide
.mouseOverSpotlight
tocomponentWillUnmount
method.