Skip to content

Conversation

ghost
Copy link

@ghost ghost commented Oct 20, 2021

Added the InsertText method. The inserted text has the same formatting as the text at the cursors position. Additionally selected text gets replaced but the inserted one.

@ADefWebserver
Copy link
Collaborator

Please give me a week to look at this and test this out.

@ghost
Copy link
Author

ghost commented Oct 22, 2021

I've noticed while the method is working fine for something like a button, it's tricky for more complex components like a dropdown. If the editor has no focus you won't be able to insert anything. So I added a Focus method and test it out. It solve this problem but I'm unsure if it should be part of the InsertText method. I would rather keep them separate and let it be the developers responsibility to call Focus before InsertText if it's required.

@ADefWebserver
Copy link
Collaborator

Implementing things like Focus makes assumptions about the application that consumes the control. This is why I keep the control very simple.

I will merge the PR.

Thank You

@ADefWebserver ADefWebserver merged commit 5475299 into Blazored:main Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant