Skip to content

Editor unable to select text programatically #31481

@nk-alex

Description

@nk-alex

Description

I have an Editor displaying a large XML text. I also have an Entry for the user to input the text to serch inside the Editor. What I want to achieve is to select (highlight) the first match of the user input text.

This doesn't seem to be working on Windows. Something like MainThread.BeginInvokeOnMainThread(() => { this.SendedXMLEditor.CursorPosition = 0; this.SendedXMLEditor.SelectionLength = 5; }); on code behind has no effect on the editor:

Image

But if I'm displaying this.SendedXMLEditor.CursorPosition and this.SendedXMLEditor.SelectionLength, and I manually select the editor text, displayed values are correct:

Image Image

Steps to Reproduce

Link to public reproduction project repository

No response

Version with bug

9.0.100 SR10

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

net9.0-windows10.0.19041.0

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions