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

[Bug] Default handling for "renderError.ufModal" #1231

Open
avsdev-cw opened this issue Nov 13, 2023 · 0 comments
Open

[Bug] Default handling for "renderError.ufModal" #1231

avsdev-cw opened this issue Nov 13, 2023 · 0 comments
Milestone

Comments

@avsdev-cw
Copy link
Contributor

Submitted by request from UF chat.

Applies to both UF4 and UF5.

If a modal causes an error (e.g. permission denied) then trying to repeat the action, or attempt to do any other action which would trigger a modal, without reloading the page does not do anything. This is because the "renderError.ufModal" event is never listened to and ufModal.destroy() is never called.

I managed to add a recursive global listener (required because the ufModal.destroy() method removes all listeners) by doing something like:

$(document).ready(function() {
    const handleModalError = function() {
        $(this).ufModal('destroy');
        $('body').on('renderError.ufModal', handleModalError);
    }
    $('body').on('renderError.ufModal', handleModalError);
});

however it causes a javscript exception (uf-modal.js:146):

Uncaught TypeError: instance is undefined
@lcharette lcharette added this to the 5.0.1 milestone Nov 25, 2023
@lcharette lcharette modified the milestones: 5.0.1, 6.0.0 Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: References
Development

No branches or pull requests

2 participants