Skip to content

SelectionPath is not cleaned form node hierarchy #1262

@sylvainheraud

Description

@sylvainheraud

Hi !

In MultiCaretAndSelectionDemo I want to remove the extra selection added by addExtraSelection.
I can hide it by calling selectRange(0,0) (thank to #1217)
But I still see instances of SelectionPath as children of ParagraphText

GenericStyledArea#subscribeToSelection listener is not called in removeSelection and so box.selectionsProperty().remove(selection); is not called.

Calling Selection#dispose does not do the job.

To check it, you can add

        area.setOnMouseClicked(e -> {
            area.removeSelection(extraSelection);
            extraSelection.selectRange(0,0);
            extraSelection.dispose();
        });

and check that the SelectionPath "another selection" still belongs to nodes.

Thank you !
Sylvain

Metadata

Metadata

Assignees

No one assigned

    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