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

Returning false from onBeforeEventEdit does not prevent the editor from showing #3641

Open
jsakalos opened this issue Oct 31, 2021 · 2 comments
Assignees
Labels
bug Something isn't working forum Issues from forum in progress

Comments

@jsakalos
Copy link

For Angular we suggest using on-functions instead of listeners object. However, returning false from onBeforeEventEdit does not prevent the default editor from showing. Using listeners with:

  listeners = {
    beforeEventEdit() {
      return false;
    }
  }

does work.

Forum post

Hi,

I replaced the default editor with a custom one just as described in the docs. However, after opening an NgDialog for our own editor and returning false in the function, the default editor still shows up for a split second.

Is this a bug or can I do something to remove that behaviour?

Below you can see some screenshots of the code and the problem I mentioned.
Screenshot 2021-10-28 at 17.47.15.png
Screenshot 2021-10-28 at 17.49.45.png

		 bug.mov
					(3.04 MiB) Downloaded 2 times

As you can see in the video, the default editor pops open for just a second and then disappears again. Could you maybe help me with that?
Screenshot 2021-10-28 at 17.47.15.png
Screenshot 2021-10-28 at 17.49.45.png

@jsakalos jsakalos added bug Something isn't working forum Issues from forum labels Oct 31, 2021
@jsakalos
Copy link
Author

jsakalos commented Nov 2, 2021

This is caused by Angular. The implementation is:

        bryntumEvents.filter(event => this[event] && this[event].observers.length > 0).forEach(event => {
            const uncapitalize = str => str.charAt(0).toLowerCase() + str.slice(1), eventName = str => uncapitalize(str.slice(2));
            bryntumConfig.listeners[eventName(event)] = e => me[event].emit(e);
        });

Angular emit() function always returns undefined regardless of what is returned from the observer.

We have not solution for it at the moment other than installing beforeXxx listeners that do return false on the native scheduler instance in ngAfterViewInit method. See the code here: https://www.bryntum.com/forum/viewtopic.php?p=95473#p95473

@jsakalos
Copy link
Author

jsakalos commented Nov 4, 2021

Related ticket: #2960

@jsakalos jsakalos self-assigned this Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forum Issues from forum in progress
Projects
None yet
Development

No branches or pull requests

1 participant