Opened 11 years ago

Closed 10 years ago

#10803 closed Bug (invalid)

dialog.hide has no effect in the onShow of the very first dialog to appear

Reported by: Marc-André Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

In the onShow of a dialog we have to check if, instead of the current dialog, we want to present a separate dialog to the user.

If we want to bypass the current dialog, we call CKEDITOR.dialog.getCurrent().hide() and do our own thing. This works fine, except if this dialog is the first one to be shown, in which case the hide() does nothing.

Digging in the code, it looks like parts.dialog.isVisible() returns false. Note that after any dialog was triggered (either this particular one or another), the parts.dialog.isVisible() in that onShow returns true instead and hide() works as expected.

In case it can be of help to anyone, I found a hack to bypass the issue by overwritting parts.dialog.isVisible = function(){ return true; } and things work fine.

Change History (1)

comment:1 Changed 10 years ago by Jakub Ś

Resolution: invalid
Status: newclosed
Version: 4.2

This is very special case and I don't see your implementation as valid. I'm sorry.

Why opening the dialog if you need to close it right away? You should either do it in traditional way i.e. open one dialog from another (colour dialog from table properties dialog) or simply write your own plugin with dialog that will be opened on regular basis (from toolbar).

As pointed by my colleague this may have some negative influence on a11y e.g. focus may be lost and not restored to editor after closing such custom dialog. This may be confusing for visually impaired users.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy