Skip to content

Props return strings #14

@jayrbolton

Description

@jayrbolton

If I do the following, my input will be disabled:

html`<input @props:disabled=${false}>`
// returns the following:
{ sel: 'input',
  data: { props: { disabled: 'false' } },
  children: undefined,
  text: undefined,
  elm: undefined,
  key: undefined }

Notice it sets disabled to the "false" string, which is truthy, so I am unexpectedly disabled.

However, if I use an overall @props=${object}, it works as expected:

html`<input @props=${{disabled: false}}>`
// returns the following:
{ sel: 'input',
  data: { props: { disabled: false } },
  children: undefined,
  text: undefined,
  elm: undefined,
  key: undefined }

Now the disabled prop is correctly a real boolean, not a string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions