Calcite-components: Bug: [calcite-radio-button] name is required even though parent group will pass it at runtime

Created on 30 Nov 2020  ·  4Comments  ·  Source: Esri/calcite-components

Summary

calcite-radio-button's name attribute is required by the typings even though it is not necessary when placed inside a group. Maybe this attribute can be made optional by the typings, but update the doc to stress that it is required when used standalone.

cc @camtran

Actual Behavior

Expected Behavior

Not setting name should not complain in the test scenario (see below).

Reproduction Steps

  1. Use the following test component snippet to see TS compilation errors for name on children.
import { Component, Host, h } from "@stencil/core";

@Component({
  tag: "calcite-test",
  shadow: true
})
export class CalciteTest {
  render() {
    return (
      <Host>
        <calcite-radio-button-group name="s" scale="s">
          <calcite-radio-button value="stencil">
            Stencil
          </calcite-radio-button>
          <calcite-radio-button value="react">
            React
          </calcite-radio-button>
          <calcite-radio-button value="ember">
            Ember
          </calcite-radio-button>
          <calcite-radio-button value="angular">
            Angular
          </calcite-radio-button>
        </calcite-radio-button-group>
      </Host>
    );
  }
}

Relevant Info

1 - assigned bug

All 4 comments

@jcfranco could you add specific steps to reproduce the TS error, such as which command on the command line you're running or perhaps what VS Code setup you need? I'm having trouble seeing the TS errors on this locally when I run npm start or npm run build.

I'm having trouble reproducing this myself. The only way I can force an error is to explicitly mark the prop as required. @camtran, could you share info on the setup that showed this TS error?

I'm having trouble reproducing this myself. The only way I can force an error is to explicitly mark the prop as required. @camtran, could you share info on the setup that showed this TS error?

It has been a while so I cannot remember the exact setup. So I went back to the component (inside the ArcGIS-Charts repo) that uses the calcite-radio-button, removed the name property and no longer got any error.

Cool, guess it's safe to close this. We can always reopen if it starts happening again.

Was this page helpful?
0 / 5 - 0 ratings