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

Cannot use input component with component helper #13119

Closed
stevesims opened this Issue Mar 17, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@stevesims

stevesims commented Mar 17, 2016

Trying to use the input component with the component helper, like as this:
passedComponent=(component 'input' type="number" value=myValue)

will result in an assertion failure like this:
Uncaught Error: Assertion Failed: You cannot use 'input' as a component name. Component names must contain a hyphen

@mixonic

This comment has been minimized.

Member

mixonic commented Mar 17, 2016

@stevesims this is correct. Creating a closure component with input is not currently possible. The justification is somewhat tied to Glimmer Components, we want to reserve the name input for those.

Going to close this for now as it is not a bug, but we can re-open and continue discussion.

@mixonic mixonic closed this Mar 17, 2016

@stevesims

This comment has been minimized.

stevesims commented Mar 17, 2016

the implication therefore is that the input component needs to get renamed - which obviously is impractical - or alternatively a standard hyphenated wrapper should be available

not being able to use a standard (inbuilt) component with the component helper seems like a rather odd and arbitrary restriction

@msmyers

This comment has been minimized.

msmyers commented Jul 16, 2018

{{#if requiresComponentSubstitution}}  

      <!-- requiresComponentSubstitution: is not "input" -->

        {{component inputComponentName
                    id=(concat elementId '-control')
                    class='form-control'
                    type=type
                    name=valuePath
                    placeholder=placeholder
                    value=value
                    input=(action 'onInput')
        }}
    {{else}}
        {{input id=(concat elementId '-control')
                class='form-control'
                type=type
                name=valuePath
                placeholder=placeholder
                value=value
                input=(action 'onInput')
        }}
    {{/if}}

I'm both offering this as a helpful workaround, and subtly suggesting that it's a drawback of using Ember. It would be fantastic if it "just worked" :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment