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

Component Data - type: 'boolean' should trigger completion without ="" #2127

Closed
octref opened this issue Aug 7, 2020 · 5 comments
Closed

Comments

@octref
Copy link
Member

octref commented Aug 7, 2020

For example, now installing element-ui and completing <el-tree expand-on-click-node=""></el-tree>. expand-on-click-node has type boolean and should trigger a completion like expand-on-click-node, not expand-on-click-node="".

octref added a commit that referenced this issue Aug 7, 2020
@rchl
Copy link
Collaborator

rchl commented Aug 7, 2020

I must just add a note that it's a bit of a preference thing too.

Some projects I work with prefer to use :expand-on-click-node="true", to be explicit.

expand-on-click-node="" is wrong for sure as it doesn't start with the colon but I wonder if it would be possible to support both options (expand-on-click-node and :expand-on-click-node="true").

If not then I can live with it I guess. Maybe will consider switching to expand-on-click-node variant.

@rchl
Copy link
Collaborator

rchl commented Aug 7, 2020

Thinking more about it, the :expand-on-click-node="" variant would be more universal as the default value is not always false so you might actually want to write :expand-on-click-node="false". Having the short form by default would require more work to switch to the long-form to put false there.

@octref
Copy link
Member Author

octref commented Aug 7, 2020

the default value is not always false

I'd say that's a minority case. That's not consistent with HTML5's boolean attributes.

When user attempts to type a boolean attribute, I think they are way more likely to use it for the truthy value, so I should make that easier for them.

In majority case, having to delete twice is worse than in the minority case, having to type =".

@rchl
Copy link
Collaborator

rchl commented Aug 7, 2020

Yeah, OK.

@octref
Copy link
Member Author

octref commented Aug 8, 2020

Associated with wrong commit...

@octref octref reopened this Aug 8, 2020
@octref octref closed this as completed in 54438d3 Aug 8, 2020
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

2 participants