Skip to content

feat(apollo-react): BaseCanvas - add flag for toggling back navigation#314

Closed
david-rios-uipath wants to merge 1 commit intomainfrom
rios/base-canvas-add-prevent-back-nav-prop
Closed

feat(apollo-react): BaseCanvas - add flag for toggling back navigation#314
david-rios-uipath wants to merge 1 commit intomainfrom
rios/base-canvas-add-prevent-back-nav-prop

Conversation

@david-rios-uipath
Copy link
Contributor

@david-rios-uipath david-rios-uipath commented Mar 9, 2026

Why do we need this flag?

The usePreventBackNavigation hook that's used in apollo-react/BaseCanvas prevents horizontal 'wheel' scroll events globally (source). It's intended to prevent accidental back navigation via gesture.

However, this hook adds a global 'wheel' event listener that intercepts and stops any horizontal scroll events. This is preventing horizontal scrolling from being implemented naturally in flow, and affects other consumers the same way.

I would prefer to delete this hook altogether, but there may be other consumers that depend on this functionality. In the meantime, we can add a flag (enableBackNavigationPrevention) to disable this hook's functionality. This gives us the ability to disable this functionality in Flow while not affecting other consumers until we're able to delete this hook in its entirety.

If we delete this hook, how do we prevent accidental gesture back navigation?

The same end result can be achieved by setting the overscroll-behavior-x property to contain on the desired scroll element (e.g. ScrollArea, BaseCanvas, etc., or at page level, html)

At the moment, I'm questioning the necessity of this hook, since even without it I'm unable to navigate backward from within BaseCanvas.

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (PT)
apollo-canvas 🟢 Ready Preview, Logs Mar 09, 2026, 05:15:48 PM
apollo-ui-react 🟢 Ready Preview, Logs Mar 09, 2026, 05:15:03 PM
apollo-vertex 🟢 Ready Preview, Logs Mar 09, 2026, 05:14:39 PM
apollo-wind 🟢 Ready Preview, Logs Mar 09, 2026, 05:14:03 PM

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@david-rios-uipath david-rios-uipath marked this pull request as draft March 9, 2026 18:51
@CalinaCristian CalinaCristian force-pushed the rios/base-canvas-add-prevent-back-nav-prop branch from d718b29 to 0220995 Compare March 10, 2026 00:12
@david-rios-uipath
Copy link
Contributor Author

david-rios-uipath commented Mar 10, 2026

Will be removing hook -- no flag needed (see #318)

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.

1 participant