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

Fix identity server input not showing errors #29272

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

Half-Shot
Copy link
Member

@Half-Shot Half-Shot commented Feb 14, 2025

This addresses a bug where the identity server input field would not show a tooltip on error as it does not use the same validation logic (for good reason, there may be a user input stage in the middle for terms and conditions acceptance).

The change would have been to adapt the existing Field to use forceTooltipVisible (d82029d) but given Compound offers a better component for this sort of thing, I switched the Field for EditInPlace.

There was one other usage of forceTooltipVisible which was being used for informational purposes. Since it was used for a settings flag, I've simply given that settings flag a description and used the new settings togglebox to reduce one usage of forceTooltipVisible.

Checklist

  • Tests written for new code (and old code if feasible).
  • New or updated public/exported symbols have accurate TSDoc documentation.
  • Linter and other CI checks pass.
  • I have licensed the changes to Element by completing the Contributor License Agreement (CLA)

@Half-Shot Half-Shot requested a review from a team as a code owner February 14, 2025 17:29
@Half-Shot Half-Shot changed the title Hs/fix error tooltip Fix identity server input not showing an error Feb 14, 2025
@Half-Shot Half-Shot changed the title Fix identity server input not showing an error Fix identity server input not showing errors Feb 14, 2025
@@ -393,28 +374,27 @@ export default class SetIdServer extends React.Component<IProps, IState> {

return (
<SettingsFieldset legend={sectionTitle} description={bodyText}>
<form className="mx_SetIdServer" onSubmit={this.checkIdServer}>
<Field
<TooltipProvider>
Copy link
Member Author

Choose a reason for hiding this comment

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

I decided that rather than trying to work around Field's validiity, we should just update this setting to use EditInPlace. This means we're using a Compound component, with support for asynchronous actions and built in support for progress and error text.

Ultimately this feels like a much better change.

@@ -60,8 +60,6 @@ interface IProps {
// If specified, contents will appear as a tooltip on the element and
// validation feedback tooltips will be suppressed.
tooltipContent?: JSX.Element | string;
// If specified the tooltip will be shown regardless of feedback
forceTooltipVisible?: boolean;
Copy link
Member Author

Choose a reason for hiding this comment

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

This PR deprecates the last user of forceTooltipVisible. Given it's a force flag, it feels reasonably okay to remove it and encourage using mode modern components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant