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

feat(toggle): add helperText and errorText properties #30161

Open
wants to merge 8 commits into
base: feature-8.5
Choose a base branch
from

Conversation

brandyscarney
Copy link
Member

@brandyscarney brandyscarney commented Jan 28, 2025

Issue number: N/A


What is the current behavior?

Toggle does not support helper and error text.

What is the new behavior?

Adds support for helper and error text, similar to input and textarea.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Copy link

vercel bot commented Jan 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ionic-framework ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 29, 2025 7:50pm

@github-actions github-actions bot added package: core @ionic/core package package: angular @ionic/angular package package: vue @ionic/vue package labels Jan 28, 2025
@brandyscarney brandyscarney changed the base branch from main to feature-8.5 January 28, 2025 23:22
Copy link
Contributor

@thetaPC thetaPC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The supporting text being read twice is the main issue.

The rest are just questions that were asked over in the checkbox PR that can be applied here.

@@ -337,6 +396,7 @@ export class Toggle implements ComponentInterface {
part="label"
>
<slot></slot>
{this.renderHintText()}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The text (helper or error) is being read twice by VoiceOver on Safari, Firefox, and Chrome. After some quick debugging, it seems that this happening because the text is inside of label. ion-input has it after the which mimics how the native input states it.

Screen.Recording.2025-01-30.at.4.30.15.PM.mov

configs({ modes: ['ios', 'md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('toggle: helper text rendering'), () => {
// Check the default label placement, end, and stacked
[undefined, 'end', 'stacked'].forEach((labelPlacement) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the reasoning for not checking fixed?

});
});

test.describe(title('toggle: error text rendering'), () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does error text not get a check for the end or fixed placement?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: angular @ionic/angular package package: core @ionic/core package package: vue @ionic/vue package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants