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

HTML Attributes vs Component Arguments #1286

Closed
MichalBryxi opened this issue Jan 28, 2020 · 4 comments
Closed

HTML Attributes vs Component Arguments #1286

MichalBryxi opened this issue Jan 28, 2020 · 4 comments

Comments

@MichalBryxi
Copy link
Contributor

MichalBryxi commented Jan 28, 2020

I’m somehow confused about the Component Arguments vs HTML Attributes thing in built-in components documentation

The <Input> component in the examples uses Component Arguments for @id, @type, @value and HTML Attributes for disabled. But then in the table of supported <input> attributes one can see value and disabled next to each other. So it’s not obvious whether one should use @ symbol or not.

My blind guess would be that the syntax should be:

<Input width={{27}} />
<Input placeholder="foo bar" />
<Input maxlength={{42}} />

But again seeing the @type and @value examples hints me that a @ symbol might be expected for width, placeholder and maxlength?

Should the table of arguments maybe have the respective @ symbols where Component Argument is expected?

@locks
Copy link
Contributor

locks commented Jan 28, 2020

The built-in components are a bit special because they were designed and implemented much prior to angle bracket syntax and the possibility to pass HTML attributes ad-hoc.
There's also something special regarding @type because if I'm remembering correctly, you cannot change the type of an input after adding it to the DOM. There's also some shenanigans going on with the ordering of the attributes. HTML 👀.

We are revisiting this as a whole and likely move it towards favouring HTML attributes, making it more clear which things have to be passed as arguments (e.g. @type) and which can be passed as HTML attributes.

@locks
Copy link
Contributor

locks commented Jan 28, 2020

Can you send a PR with the change you mentioned? And tweaking the "You can pass the following standard attributes within the input helper:" prose to make sure it mentions component arguments?

MichalBryxi pushed a commit to MichalBryxi/guides-source that referenced this issue Feb 8, 2020
MichalBryxi pushed a commit to MichalBryxi/guides-source that referenced this issue Feb 8, 2020
MichalBryxi pushed a commit to MichalBryxi/guides-source that referenced this issue Feb 8, 2020
MichalBryxi pushed a commit to MichalBryxi/guides-source that referenced this issue Feb 8, 2020
MichalBryxi pushed a commit to MichalBryxi/guides-source that referenced this issue Feb 8, 2020
@jamescdavis
Copy link
Contributor

jamescdavis commented Apr 30, 2020

Is this closed by #1296? @jenweber

@locks
Copy link
Contributor

locks commented Apr 30, 2020

Further work is tracked at #1254.

@locks locks closed this as completed Apr 30, 2020
lenoraporter pushed a commit to lenoraporter/guides-source that referenced this issue Jul 19, 2020
lenoraporter pushed a commit to lenoraporter/guides-source that referenced this issue Jul 19, 2020
lenoraporter pushed a commit to lenoraporter/guides-source that referenced this issue Jul 19, 2020
lenoraporter pushed a commit to lenoraporter/guides-source that referenced this issue Jul 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants