vue-form-json-schema
vue-form-json-schema copied to clipboard
Element UI Input Behavior
I am using Element UI components in this example.
Everytime I typing in the input component (el-input
), the cursor is always jump to the end of the character. How to prevent this behavior? ~~Can I~~ How to correctly use Element UI components with this great library? Thank you
Hi, thanks for reporting this issue.
I see the problem and I am not sure what causes it. It kind of looks like they're setting the value of the input element every time the prop value changes, but I'm not sure where the problem lies. I'll have to read the source code for the el-input
component and see what causes this behavior.
I'll get back to you as soon as I've found what causes the issue.
Many thanks for your quick response and to following up this issue, @jarvelov.
Did you find the cause / solution for this?
Hi @aaryadewa and @keybrdist
I did actually finally track down what caused this issue today. I have a partial fix released in v2.9.1
. However, I can't get codesandbox to upgrade to the new version though so I can't provide a demo link right now. I will edit this comment tomorrow and include a fork of this example with VFJS upgraded to v2.9.1
where I demonstrate the partial fix.
It will take a bit more work to provide a complete solution, but I'm feeling confident it is within reach.
Just an update. I haven't found a proper solution yet but I am still trying to find a way to get the el-input
component play nice with VFJS.
Thanks for your time on this!
For now I implemented a work around by changing the input type to just a regular html input inside a div with class name "el-input", "el-textarea", etc.. as well as class names "el-input__inner", "el-textarea__inner", etc.. applied to the actual input element. This effectively works exactly the way it should as far as I can tell. I also used "blur" as my "on" listeners, however that may only have been necessary for my own needs.