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

Bug : when deleting, onkeydown not fire #23

Closed
Makio64 opened this issue Jun 9, 2020 · 3 comments
Closed

Bug : when deleting, onkeydown not fire #23

Makio64 opened this issue Jun 9, 2020 · 3 comments

Comments

@Makio64
Copy link

Makio64 commented Jun 9, 2020

When you press back arrow ( to delete the previous character ) the onkeydown is not called.

@Makio64
Copy link
Author

Makio64 commented Jun 9, 2020

the property input.text is not update and different from input.htmlInput.value

@Makio64 Makio64 changed the title bug when deleting, onkeydown not fire Bug : when deleting, onkeydown not fire Jun 9, 2020
@Mwni
Copy link
Owner

Mwni commented Jun 9, 2020

If you look at the source code, both things are forwarded directly, input.text is infact input.htmlInput.value, and they keydown event is piped through unconditionally. must be your browser or OS.

@Mwni Mwni closed this as completed Jun 9, 2020
@Makio64
Copy link
Author

Makio64 commented Jun 9, 2020

I tested and report all bug on windows chrome.

it probably come from something like that :
https://stackoverflow.com/questions/2353550/how-to-capture-a-backspace-on-the-onkeydown-event/2353562

For peoples looking to a quickfix:

this.latestValue = ''
const onUpdate=() => {
	if (this.input.htmlInput.value != this.latest) {
		this.onType()
	}
	requestAnimationFrame ( onUpdate )
}
requestAnimationFrame ( onUpdate )

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

No branches or pull requests

2 participants