[Modal] Allow dynamic configs by reevaluating its properties on show
Nobody has claimed this yet.
- Dominant language
- MDX
- Stars
- 175k
- Forks
- 78.6k
- Avg merge
- 7h 19m
- Merged PRs (30d)
- 35
Description
Prerequisites
- I have searched for duplicate or closed feature requests
- I have read the contributing guidelines
Proposal
My proposal is to reevaluate the passed options to the Modal constructor when show() is called.
A perfect working example of this is how Tooltip handles certain properties, like placement or title.
{
"placement": () => this.placement,
"title": () => this.title
}
I'd like to see similar behaviour for the modal, like so:
{
"backdrop": () => this.shouldShowBackdrop,
"focus": () => this.shouldFocus,
"keyboard": () => this.allowKeyboard,
}
Motivation and context
We're creating a modal using its constructor early in the runtime of the application. Then at later points in time, we pass dynamic content to the modal and then call show. The only problem with this approach is that we can't change any of the configuration initially passed into the constructor, like keyboard, once the modal instance was created.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Modal constructor and show() behavior described in the issue, then compare how Tooltip reevaluates properties such as placement and title. Done means configuration values supplied to Modal can be reevaluated when show() is called, including the dynamic backdrop, focus, and keyboard examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100