textfiled on keyup.enter
vicmars5 opened this issue · comments
Victor Diaz commented
Hello, I am not sure if is posibble to pass a method to execute when enter key is pressed?, or do i need to modify the textfield component to add the functionallity?.
dsl101 commented
You can bind a method you provide to the keyup
event. For example, use this for the Enter key:
<mdl-textfield @keyup.native.enter="onEnter"></mdl-textfield>
.
.
.
methods: {
onEnter () {
.
.
.
The .native
modifier is needed, and if you want to catch every key, just leave out the .enter
modifier in the event binding.