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

Add Input Message to form components for form validation #8057

Closed
16 of 21 tasks
benelan opened this issue Oct 25, 2023 · 12 comments
Closed
16 of 21 tasks

Add Input Message to form components for form validation #8057

benelan opened this issue Oct 25, 2023 · 12 comments
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. calcite-components Issues specific to the @esri/calcite-components package. design Issues that need design consultation prior to development. enhancement Issues tied to a new feature or request. estimate - 5 A few days of work, definitely requires updates to tests. p - medium Issue is non core or affecting less that 60% of people using the library p3 - want for upcoming milestone User set priority status of p3 - want for upcoming milestone ready for dev Issues ready for development implementation.

Comments

@benelan
Copy link
Member

benelan commented Oct 25, 2023

Check existing issues

Description

We are in the process of improving our form validation story. One of the items is to replace the native validation message UI with calcite-input-message (#8000). First wee need to add an Input Message to our form components.

Acceptance Criteria

  • Add a calcite-input-message to our form components, which will display under the internal element.
  • Add validation-message and validation-icon properties so users can change the message's values on their end.
  • Investigate adding a way to adjust spacing between the internal form element and the input-message via a CSS variable.

Relevant Info

No response

Which Component

The following input components need an internal input-message, and a status property if they don't have one.

  • combobox
  • input-time-zone
  • input-date-picker
  • input-number
  • input-text
  • input-time-picker
  • input
  • text-area

The following have the required property, which means they will need a validation message displayed via #8000.

  • select
  • checkbox [2]
  • radio-button-group [1]
  • slider [1]
  • rating [1] [3]
  • segmented-control [1] [3]

[1]: needs design for status prop due to different UI than the "input components" listed above.
[2]: needs design for internal input-message due to potential spacing issues
[3]: required prop is marked as internal in #2777 pending design. Can be made public as part of this issue.

The following don't need an internal input-message for #8000 because they don't have any constraint validation properties. Should they receive an internal input-message anyway? If so, do they need a status property as well?

  • switch
  • meter

Example Use Case

Form validation and other help messages.

Priority impact

p3 - want for upcoming milestone

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/eslint-plugin-calcite-components

Esri team

N/A

@benelan benelan added enhancement Issues tied to a new feature or request. 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Oct 25, 2023
@github-actions github-actions bot added p3 - want for upcoming milestone calcite-components Issues specific to the @esri/calcite-components package. labels Oct 25, 2023
@geospatialem geospatialem added 1 - assigned Issues that are assigned to a sprint and a team member. and removed 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Oct 27, 2023
@geospatialem geospatialem added this to the 2023 November Priorities milestone Oct 27, 2023
@benelan benelan added 2 - in development Issues that are actively being worked on. and removed 1 - assigned Issues that are assigned to a sprint and a team member. labels Nov 30, 2023
@benelan
Copy link
Member Author

benelan commented Nov 30, 2023

@ashetland, @SkyeSeitz - I updated the issue body, but TLDR; the following components needs designs for the status property:

  • slider
  • radio-button-group
  • rating
  • segmented-control

Not sure where the invalid coloring should be applied for slider. Just the handle? Or the whole slider?

And then the other three all have child elements and I'm not sure how design wants the invalid styling, especially with focus.

checkbox needs design for the internal input message. Should the input-message be under the component, or inline? I feel like either would potentially break existing apps.

And then switch and meter do not need the status property and internal input-message for the validation work in #8000, but I'd like design feedback on whether they should be added anyway for consistency across all form components.

@benelan benelan added estimate - 3 A day or two of work, likely requires updates to tests. estimate - 5 A few days of work, definitely requires updates to tests. and removed estimate - 3 A day or two of work, likely requires updates to tests. labels Nov 30, 2023
benelan added a commit that referenced this issue Dec 1, 2023
…atus` property (#8304)

**Related Issue:** #8057 #3406

## Summary

Add the `status` property to additional form components in preparation
of adding internal input messages for validation. I split these changes
out from #8305, which is where the new stories are.
@benelan benelan added the design Issues that need design consultation prior to development. label Dec 14, 2023
@benelan
Copy link
Member Author

benelan commented Dec 14, 2023

@ashetland, @SkyeSeitz - I updated the issue body, but TLDR; the following components needs designs for the status property:

  • slider
  • radio-button-group
  • rating
  • segmented-control

Not sure where the invalid coloring should be applied for slider. Just the handle? Or the whole slider?

And then the other three all have child elements and I'm not sure how design wants the invalid styling, especially with focus.

checkbox needs design for the internal input message. Should the input-message be under the component, or inline? I feel like either would potentially break existing apps.

And then switch and meter do not need the status property and internal input-message for the validation work in #8000, but I'd like design feedback on whether they should be added anyway for consistency across all form components.

Added the design label to this issue and assigned designers for the above items. Let me know if I can answer any questions from my end. Thanks!

cc @geospatialem @brittneytewks

@geospatialem geospatialem added 1 - assigned Issues that are assigned to a sprint and a team member. and removed 0 - new New issues that need assignment. labels Jan 3, 2024
@geospatialem geospatialem added 2 - in development Issues that are actively being worked on. and removed needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. 1 - assigned Issues that are assigned to a sprint and a team member. labels Jan 3, 2024
@jcfranco
Copy link
Member

jcfranco commented Jan 5, 2024

Segmented Control

...
Q: Is the required prop applicable since it should always have a selected item?

Segmented control follows the radio group pattern, which does allow for none of the items to be selected initially (we have a test for this use case as well), so I think required is applicable from that perspective.

benelan added a commit that referenced this issue Jan 9, 2024
…ted-control, select): add required property (#8517)

**Related Issue:** #8057

## Summary

Remove the `@internal` tag from the `required` property on form
components.

---------

Co-authored-by: Kitty Hurley <[email protected]>
Co-authored-by: Matt Driscoll <[email protected]>
benelan added a commit that referenced this issue Jan 11, 2024
**Related Issue:** #8057

## Summary

- Reflect the `validationIcon` - brought up in
#8561 (comment)
- Add `validationIcon`, `validationMessage`, and `status` properties to
the reflects and defaults common tests - brought up in
#8561 (comment)
@brittneytewks brittneytewks added the p - medium Issue is non core or affecting less that 60% of people using the library label Jan 11, 2024
benelan added a commit that referenced this issue Jan 16, 2024
…alidationIcon, and status properties (#8561)

**Related Issue:** #8057

## Summary

Add `validationMessage`, `validationIcon`, and `status` properties to
`calcite-radio-button-group` and `calcite-segmented-control` for form
validation.
@benelan benelan added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 2 - in development Issues that are actively being worked on. labels Jan 16, 2024
@github-actions github-actions bot assigned geospatialem and DitwanP and unassigned benelan Jan 16, 2024
Copy link
Contributor

Installed and assigned for verification.

@geospatialem geospatialem added 4 - verified Issues that have been released and confirmed resolved. and removed 3 - installed Issues that have been merged to master branch and are ready for final confirmation. labels Jan 17, 2024
@geospatialem
Copy link
Member

geospatialem commented Jan 17, 2024

Verified in 2.2.0-next.22 via https://codepen.io/geospatialem/pen/dyrvmPy for:

  • checkbox (and label) with the status="invalid" and required
  • status="invalid" + validation-icon+validation-message` for:
    • combobox
    • input-date-picker
    • input-time-picker
    • segmented-control
    • select

image

@driskull
Copy link
Member

driskull commented Aug 7, 2024

The latest comment says that rating and slider should have a validationMessage property? is that still the case? should there be an issue?

@SkyeSeitz
Copy link

From my memory, they should have a validationMessage prop to go with its required prop. Since invalid styling is not really effective on these components, the validationMessage prop would serve as the only visual invalid affordance.

@driskull
Copy link
Member

driskull commented Aug 7, 2024

Should we reopen this one or create a new one? @geospatialem @DitwanP

@geospatialem
Copy link
Member

Since invalid styling is not really effective on these components, the validationMessage prop would serve as the only visual invalid affordance.

Apologies this was missed when I was verifying - we had multiple issues that were related to form validation closing at once, and I didn't verify the effort for rating and slider. Created a new issue and added to October: #9999. If there's an associated Figma file, can add it to the issue as well. cc @driskull @SkyeSeitz

@github-actions github-actions bot added the p3 - want for upcoming milestone User set priority status of p3 - want for upcoming milestone label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - verified Issues that have been released and confirmed resolved. calcite-components Issues specific to the @esri/calcite-components package. design Issues that need design consultation prior to development. enhancement Issues tied to a new feature or request. estimate - 5 A few days of work, definitely requires updates to tests. p - medium Issue is non core or affecting less that 60% of people using the library p3 - want for upcoming milestone User set priority status of p3 - want for upcoming milestone ready for dev Issues ready for development implementation.
Projects
None yet
Development

No branches or pull requests

8 participants