-
Notifications
You must be signed in to change notification settings - Fork 14
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(sbb-toggle): implement form association #3409
base: main
Are you sure you want to change the base?
Conversation
// Enforce disabled state from parent. | ||
if (!this._toggle) { | ||
// Ignore illegal state. Our expectation is that a sbb-toggle-option | ||
// always has a parent sbb-toggle. | ||
} else if (this._toggle.disabled && !this.disabled) { | ||
this.disabled = true; | ||
} else if (!this._toggle.disabled && this.disabled) { | ||
this.disabled = false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this logic to simplify the dependency between the toggle
and the toggle-option
.
I decided to do it for two reasons:
1 - The sbb-toggle
is also disabled when formDisabled
. Which is a protected property that is not accessible from the toggle option.
2 - It was a protection against a misuse case (which we generally do not cover)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice and clean work, should hopefully be okay :D one change about a breaking change needed.
@@ -97,8 +97,55 @@ class SbbToggleElement extends LitElement { | |||
this.addEventListener?.('keydown', (e) => this._handleKeyDown(e)); | |||
} | |||
|
|||
/** @internal */ | |||
public updatePillPosition(resizing: boolean): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to avoid a breaking change, we should keep the method and mark it deprecated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though it was marked as internal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think yes, @kyubisation your opinion?
This PR Closes #3364
Note for reviewers
I added a few comments to clarify the decisions I took during development