Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

Intercept nav events and and prevent consequent logic from unfolding? #153

Open

Description

@jayarjo

Is there a way to intercept nav events and prevent consequent logic from unfolding? Obviously one can intercept keydown, but that would be cumbersome, would be great if nav events themselves behaved similarly.

Activity

  1. jihyerish commented on Feb 25, 2019

    @jihyerish
    Collaborator

    @jayarjo Thanks for your feedback!
    Yes, as you pointed out, there wasn't the procedure about preventing the navigation events in the previous polyfill.
    I updated the polyfill with #156, and now you can prevent the events.

    You can see how it works in this demo.

  2. jayarjo commented on Feb 25, 2019

    @jayarjo
    Author

    @jihyerish great that there's progress on this! But do you actually reset those global flags back to initial value anywhere? Or they are not meant to?

  3. jihyerish commented on Feb 25, 2019

    @jihyerish
    Collaborator

    @jayarjo Yes, the flags are used for defining the prevent default behavior for the navigation events. Those flags are set as true when the events are triggered.
    And if those flags are set as true, in the processing model flows to the prevented behavior of the corresponding events.

    For example, in the polyfill code line 316 -319, it follows the prevented behavior of navbeforescroll.

          if (!navbeforescrollPrevented) {
            moveScroll(container, dir);
            return true;
          }
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions