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

[DOC] Added on modifier example to the input component #19205

Closed
wants to merge 1 commit into from

Conversation

stevetyler
Copy link

@stevetyler stevetyler commented Oct 16, 2020

@stevetyler stevetyler changed the title used the on modifier for enter used the on modifier for input Oct 16, 2020
@stevetyler stevetyler changed the title used the on modifier for input Added on modifier example to the input component Oct 16, 2020
@jenweber jenweber changed the title Added on modifier example to the input component [DOC] Added on modifier example to the input component Oct 16, 2020
Copy link
Contributor

@jenweber jenweber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thank you!

@jenweber jenweber requested a review from locks October 16, 2020 14:23
@jenweber
Copy link
Contributor

@locks I tagged you since I think you know how/when to merge things in this repo. If not, can you tag another reviewer?

@jenweber jenweber requested a review from chancancode October 16, 2020 14:30
@jenweber
Copy link
Contributor

@chancancode this PR aligns the API docs with what we landed on for the Guides ember-learn/guides-source#1546. If you could review & merge if it seems good, that would be great! Thank you!

Copy link
Member

@chancancode chancancode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think?

@@ -38,7 +38,13 @@ import InternalComponent from './internal';

### Actions

The `Input` component takes a number of arguments with callbacks that are invoked in response to
There are multiple ways to pass actions to the input component. Starting with Ember Octane, we recommend using the `{{on}}` modifier to call an action on specific events such as the input event.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
There are multiple ways to pass actions to the input component. Starting with Ember Octane, we recommend using the `{{on}}` modifier to call an action on specific events such as the input event.
The recommended way of handling DOM events is to use the `{{on}}` modifier. For example, to specify a callback for the `input` event:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we cross link to the documentation for the on modifier if that's available?

@@ -38,7 +38,13 @@ import InternalComponent from './internal';

### Actions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Actions
### Events

<Input @value={{this.name}} {{on "input" this.validateName}} />
```

The `Input` component also takes a number of arguments with callbacks that are invoked in response to
user events.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
user events.
other events.

<Input @value={{this.name}} {{on "input" this.validateName}} />
```

The `Input` component also takes a number of arguments with callbacks that are invoked in response to
user events.

* `enter`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `enter`
* `enter` (synthetic event)

IMO we should do this for this for all the synthetic events and at the end of the list mention what they are (something along the lines of "Some of these do not correspond to a DOM event. Instead, they are synthetic/logical events that are fired by the Input component when a high-level user action is take (such as pressing the Enter key).")

@mansona
Copy link
Member

mansona commented Nov 5, 2020

Hey @stevetyler 👋 have you seen @chancancode 's suggestions? let us know if you need any help moving this forward 👍

@locks
Copy link
Contributor

locks commented Dec 1, 2020

Hey @stevetyler :) Do you have some time or do you need some help with the remaining work?

@bertdeblock
Copy link
Member

#19314 was made (and merged) to address the same issue. Is this PR still needed?

@rwjblue
Copy link
Member

rwjblue commented Mar 1, 2021

kk, good point @bertdeblock thanks for the reminder!

Closing in favor of #19314 (thanks for everyones hard work here!!).

@rwjblue rwjblue closed this Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants