Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incorrect typings for Modal hide() method #3180

Merged
merged 2 commits into from Nov 23, 2021
Merged

Conversation

davwheat
Copy link
Member

Changes proposed in this pull request:

The hide() method of the Modal class will have an event passed as the first param when clicking the Modal's close button due to how the onclick handler is set.

Reviewers should focus on:

Should we change the this.hide.bind(this) to () => this.hide() instead of this? Could be breaking, but I'd argue this param was never public API, really.

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension?
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).
  • Core developer confirmed locally this works as intended.
  • Tests have been added, or are not appropriate here.

@davwheat davwheat added this to the 1.2 milestone Nov 23, 2021
@davwheat davwheat self-assigned this Nov 23, 2021
@davwheat davwheat added this to In progress in Typescript rewrite via automation Nov 23, 2021
@askvortsov1
Copy link
Sponsor Member

Should we change the this.hide.bind(this) to () => this.hide() instead of this? Could be breaking, but I'd argue this param was never public API, really.

Is there a use case for using the original mouse event while closing the modal? I don't see one, so this might be preferable to keep things simpler.

@davwheat davwheat merged commit afbf5f4 into master Nov 23, 2021
@davwheat davwheat deleted the dw/fix-modal-typings branch November 23, 2021 22:54
Typescript rewrite automation moved this from In progress to Done Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants