Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextEdit jump caret to the end of the text for every typed char, when ChangeTextOnKeyPress is true. #733

Closed
ianido opened this issue Apr 14, 2020 · 8 comments · Fixed by #963

Comments

@ianido
Copy link

ianido commented Apr 14, 2020

  • Version 0.8.8.4
  • Material Design
  • Google Chrome

If I have options.ChangeTextOnKeyPress = true;

The behavior of TextEdit jump the carent to the end of the text on every change, making impossible to edit the text properly (like insert letters at front or middle):

<TextEdit @bind-Text="@this.Criteria.OpenDateFromText" />

I Replaced temporarily by

<input @bind-value="@this.Criteria.OpenDateFromText" @bind-value:event="oninput" class="form-control" />

@WillianGruber
Copy link
Contributor

Happens to me too

@stsrki
Copy link
Collaborator

stsrki commented Apr 14, 2020

This is the same problem as #655. It is also reported on dotnet/aspnetcore#20067

Basically as Steve has mentioned, the problem is that Blazor needs to update component value. And by doing so browser will automatically refresh it and the cursor will move to the end.

It seems there is a workaround posted. I will try to see if it can be copied to Blazorise.

@stsrki stsrki added the Type: Feature Request ⛱ New feature or request label Apr 18, 2020
@stsrki stsrki added this to the 0.9.1 milestone Apr 18, 2020
@stsrki stsrki added this to Backlog in Development via automation Apr 19, 2020
@stsrki stsrki mentioned this issue Apr 19, 2020
49 tasks
@stsrki stsrki moved this from Backlog to To do in Development Apr 20, 2020
@stsrki stsrki moved this from ⏳ To do to 💪 In progress in Development May 22, 2020
@stsrki
Copy link
Collaborator

stsrki commented May 22, 2020

@ianido @WillianGruber Guys, I have started this ticket and now I'm trying to reproduce the bug but for me everything works. I would swear it was failing before. Coould be that Blazor team has changed somethings in latest version(s) and it's working now. Can you please check again if it works on your side?? Just make sure that you have latest version of Blazor 3.2 and Blazorise 0.9.0.3!

@WillianGruber
Copy link
Contributor

I'll try to reproduce it.

@stsrki
Copy link
Collaborator

stsrki commented May 30, 2020

@WillianGruber Did you test it? If everything works I would close the issue.

@WillianGruber
Copy link
Contributor

I reproduced and the bug still happens:
Here you can see what happens when I try to type "asdfasdfasdfasdf":
Test1

This is what happens when I hold the "." key. It starts flickering and don't register all ".". In the end, when my mouse is circling I have already stopped pressing the "." key but it is still updating the field.
Test2

@WillianGruber
Copy link
Contributor

WillianGruber commented May 30, 2020

By the way, this only happens in a hard to render page. In this case, I have that old IconPicker I made.
I usually enclose it with "@if (Modal.Visible)" so I don't render the modal with all those icons unless the modal is really visible. This way, when editing other fields in the page, the problem above is mitigated.

(I removed "@if (Modal.Visible)" temporally to reproduce the issue)

@stsrki
Copy link
Collaborator

stsrki commented May 30, 2020

@WillianGruber Thanks, I managed to reproduce it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development
  
✔ Done
Development

Successfully merging a pull request may close this issue.

3 participants