ember-cli-materialize icon indicating copy to clipboard operation
ember-cli-materialize copied to clipboard

TypeError when closing a Modal

Open Gorzas opened this issue 6 years ago • 4 comments

Describe the bug When I try to close a modal clicking outside it, the console throws an error and it doesn't calls the action to close in the controller. I think it's a problem with the latest versions of Ember and the compatibility with the library modal-dialog.

This is because this.get('onClose') in model-dialog is a string instead a function.

To Reproduce Steps to reproduce the behavior:

  1. Open a md-modal.
  2. Click outside the modal.
  3. In the console, you're going to see the following: TypeError: this.get(...) is not a function.

Expected behavior It should call the controller action.

Desktop (please complete the following information):

  • Browser Chrome 73 and Firefox
  • Ember 3.4.4

Additional context I think that's going to need to remove sendAction in the following lines. Like this:

  cancel() {
    this.close();
  },

  actions: {
    closeModal() {
      this.close();
    }
}

Not tested. Could it have some problem with older Ember versions? The change is very little so I'm going to make and discuss about it after being done.

Gorzas avatar May 23 '19 12:05 Gorzas

@mike-north why not accept PR ?

vladern avatar Jun 24 '21 16:06 vladern

@mike-north why not accept PR ?

I suspect that he has not had time or interest to continue maintaining this project (I know that that happens to me quite a bit -- it's often more involved than simply accepting a PR: review, CI tweaks, changelog, publishing, ...). There's quite a bit of effort that would be needed to bring this addon up to the latest Ember conventions, etc. There has also been very little visible activity on Materialize (see https://github.com/Dogfalo/materialize/issues/6438#issuecomment-737273317), which may also be contributing.

jacobq avatar Jun 24 '21 16:06 jacobq

@mike-north why not accept PR ?

I suspect that he has not had time or interest to continue maintaining this project (I know that that happens to me quite a bit -- it's often more involved than simply accepting a PR: review, CI tweaks, changelog, publishing, ...). There's quite a bit of effort that would be needed to bring this addon up to the latest Ember conventions, etc. There has also been very little visible activity on Materialize (see Dogfalo/materialize#6438 (comment)), which may also be contributing.

He had a year to review the PR, so I can assume that this project is abandoned, true ?

vladern avatar Jun 25 '21 06:06 vladern

@vladern the project needs a lot of work to be maintained. I don't know if the developer is going to take a look to all PRs. The best way to go is to create a fork of the project. I made a lot of improvements (never merged into master) and I have a lot of knowledge of the repo, let me know if you need help with that 😄 .

Gorzas avatar Jun 25 '21 06:06 Gorzas