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

Using input helper, how can we pass both the value and event to the action? #16989

Closed
elimau opened this issue Sep 19, 2018 · 4 comments
Closed

Comments

@elimau
Copy link

elimau commented Sep 19, 2018

As per the ember latest (3.4), in the docs
https://guides.emberjs.com/release/templates/input-helpers/
it says if you set the value, the value will be sent to the action as the first param.
Otherwise, it will send the event as the first param.

However, I need both the value and the event to be passed to the action.
How can I get that to work with the latest ember?

The below code shows an example of a template code and component (js) code.

hbs:
{{input placeholder=placeholder class="type-in" autocomplete="off" value=value key-up="keyUp" key-down="keyDown" insert-newline="enter" bubbles=false }}

js:
actions: { keyUp(text, event) { ... } }

The above code used to work in ember 2.9.0. Both the value and event used to get passed to the keyUp action. Now, I upgrade to ember 3.4, it only sends the value, the second param (event) is null.
Thanks for any help.

@btecu
Copy link
Contributor

btecu commented Sep 27, 2018

I've also run into this in 3.4.

@raphaelns-developer
Copy link

Same here. After updated to Ember 3.4 the key-down and key-up action stop to sending the event. I made a simple twiddle to show the error: https://ember-twiddle.com/198760441072c804776732de6b68954b?openFiles=controllers.application.js%2C

ssutar pushed a commit to ssutar/ember.js that referenced this issue Oct 11, 2018
ssutar pushed a commit to ssutar/ember.js that referenced this issue Oct 11, 2018
ssutar pushed a commit to ssutar/ember.js that referenced this issue Oct 11, 2018
ssutar pushed a commit to ssutar/ember.js that referenced this issue Oct 11, 2018
ssutar pushed a commit to ssutar/ember.js that referenced this issue Oct 12, 2018
himynameisjonas pushed a commit to Teamtailor/ember.js that referenced this issue Oct 17, 2018
@stfnio
Copy link

stfnio commented Oct 22, 2018

Hi there! Do you have ETA for the bugfix?

@rwjblue
Copy link
Member

rwjblue commented Oct 22, 2018

the patch already landed, and will be included in the next 3.4.x version (hopefully releasing today/tomorrow)

@rwjblue rwjblue closed this as completed Oct 22, 2018
rwjblue pushed a commit that referenced this issue Oct 29, 2018
rwjblue pushed a commit that referenced this issue Oct 29, 2018
rwjblue pushed a commit that referenced this issue Oct 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants