Skip to content
This repository was archived by the owner on Oct 6, 2020. It is now read-only.
This repository was archived by the owner on Oct 6, 2020. It is now read-only.

feature: More control over modal #131

Description

@mathewmorris

Problem
I would like to be able to handle the modal's state if I want to. Right now, I'm forced to close the modal on background click. I could turn it off, and handle the click on my own, but I'll have to target the background and add an event listener to do so.

Solution
The modal will use onClose prop for both pressing the escape key AND on background click. This way, I can control what happens when the modal has been triggered to close.

Alternatives/Context
Maybe adding more granularity and describing those events. Maybe pass a name of which event is being fired, that way I can do different actions on those events. Or, just have separate props I can pass in to do different actions based on what I pass, and default to use onClose if nothing is passed in. For example having onBackgroundClick, onEscapePress, & onClose all as props to pass through.

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