Skip to content

Commit

Permalink
add deprecated comment for status prop
Browse files Browse the repository at this point in the history
  • Loading branch information
Yona Nagayama committed Jan 24, 2022
1 parent 97ec490 commit ee0f2bf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/components/calcite-input/calcite-input.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,13 @@ describe("calcite-input", () => {
it("inherits requested props when from wrapping calcite-label when props are provided", async () => {
const page = await newE2EPage();
await page.setContent(html`
<calcite-label status="invalid" scale="s">
<calcite-label scale="s">
Label text
<calcite-input></calcite-input>
</calcite-label>
`);

const element = await page.find("calcite-input");
expect(await element.getProperty("status")).toEqual("invalid");
expect(await element.getProperty("scale")).toEqual("s");
});

Expand Down
5 changes: 4 additions & 1 deletion src/components/calcite-label/calcite-label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ export class CalciteLabel {
/** specify the text alignment of the label */
@Prop({ reflect: true }) alignment: Alignment = "start";

/** specify the status of the label and any child input / input messages */
/**
* specify the status of the label and any child input / input messages
* @deprecated status is no longer supported, set status directly in child input / input messages
*/
@Prop({ reflect: true }) status: Status = "idle";

/** The id of the input associated with the label */
Expand Down
6 changes: 3 additions & 3 deletions src/components/calcite-label/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ Renders a `<label>` around its children and can be used with any [labelable nati
### Basic

```html
<calcite-label status="invalid">
<calcite-label>
Invalid input
<calcite-input status="invalid" type="search" placeholder="Filter your files" value="adfo2h2"></calcite-input>
<calcite-input-message status="invalid" active icon> Something doesn't look right </calcite-input-message>
<calcite-input type="search" placeholder="Filter your files" value="adfo2h2" status="invalid"></calcite-input>
<calcite-input-message active icon status="invalid"> Something doesn't look right </calcite-input-message>
</calcite-label>
```

Expand Down

0 comments on commit ee0f2bf

Please sign in to comment.