Skip to content

InteractionDialog: not reliably removed on dispose() #5067

@ThomasH99

Description

@ThomasH99

in 7.0.244. when running the code below and pressing "Close" the InteractionDialog usually is not removed (it seems sometimes it is removed, but can't find out why the behavior isn't consistent).

Example of screenshot below where "Close" is pressed (and then shows "Show").

If the ID is not removed, then scrolling the form makes it disappear.

NB. If setAnimateShow(true) so the adding/removal is animated, the ID reliably disappears on Close.

I assume this issue is not fixed by the changes made in #5030.

Image
                Container items = new Container(BoxLayout.y());
                Button closeButton = new Button("THIS entry ");
                for (char c = 'A'; c <= 'Z'; c++) {
                    items.add(new Label(c + " entry "));
                    if (c == 'N') {
                        items.add(closeButton);
                    }
                }

                InteractionDialog interactionDialog = new InteractionDialog("InteractionDialog");
                interactionDialog.setFormMode(true);
                interactionDialog.setAnimateShow(false);
                interactionDialog.setDisposeWhenPointerOutOfBounds(false);

                closeButton.setCommand((Command.create("Close", null, e -> {
                    if(closeButton.getText().equals("Close")) {
                        interactionDialog.dispose();
                        closeButton.setText("Show");
                    }else {
                        interactionDialog.showPopupDialog(closeButton);
                        closeButton.setText("Close");
                    }
                })));

                Form form = new Form("ID not removed on dispose()", new BoxLayout(BoxLayout.Y_AXIS)) {
                    @Override
                    protected void onShowCompleted() {
                            interactionDialog.showPopupDialog(closeButton);
                    }
                };
                form.add(items);
                form.show();

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions