2

All,

I have been trying to get my input (type=text) to dynamically resize the input box. I have read multiple posts in SO, but was trying to come up with the simplest solution.

I have my simple component up and running at: https://stackblitz.com/edit/angular-dynamic-textbox-width

Firstly, I do not understand why the width property is not taking effect in the [style.width]. What am I missing?

Any help would be much appreciated!

1 Answer 1

7

you forgot to put px at the end

change [style.width]='width' to [style.width.px]='width' :D

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.