Skip to content

Fullscreen overlay mode does not exit on ESC key #43

Open
@indigoxela

Description

@indigoxela

First of all: many thanks for this cool library, Flickity really rocks. 🌟

While playing with the fullscreen plugin I encountered a problem with keyboard handling, though.
The Escape key doesn't close the overlay.

Here's the code: https://github.com/metafizzy/flickity-fullscreen/blob/master/fullscreen.js#L92

However, Flickity.keyboardHandlers doesn't expect the number from event.which, but apparently the string from event.key: https://github.com/metafizzy/flickity/blob/master/js/core.js#L787

Maybe that behavior changed at some point in the past...

Following fixes it for me:

// ESC key closes full screen
Flickity.keyboardHandlers['Escape'] = function() {
  this.exitFullscreen();
};

Is there interest in a pull request, or is this trivial change not worth it, anyway?

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