Skip to content
Advertisement

Text flows out of input after next event is fired if input is focued

While building a basic application, when I click a button, the text inside my currently focused input overflows only in Chrome. However, that text can be accessed using (right) arrow key(s). Is there any way to avoid this? I tried clipboard copy-paste but that did not work.

JavaScript
JavaScript
JavaScript

Live site: https://kaustubhmaladkar.github.io/Tip-Calculator/

Code on Github: https://github.com/KaustubhMaladkar/Tip-Calculator/

Advertisement

Answer

The problem comes from this line:

JavaScript

If you only want a alignment to the right, change it to:

JavaScript

Working example:

JavaScript
JavaScript
JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement