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(sbb-form-field): remove deprecated getInputElement() method #3221

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/elements/datepicker/common/datepicker-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ export abstract class SbbDatepickerButton<T = Date> extends SbbNegativeMixin(Sbb
if (formField) {
this.negative = formField.hasAttribute('negative');

// We can't use getInputElement of SbbFormFieldElement as async awaiting is not supported in connectedCallback.
// We here only have to look for input.
const inputElement = formField.querySelector('input');

if (inputElement) {
Expand Down
8 changes: 0 additions & 8 deletions src/elements/form-field/form-field/form-field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,14 +427,6 @@ class SbbFormFieldElement extends SbbNegativeMixin(SbbHydrationMixin(LitElement)
this._checkAndUpdateInputEmpty();
}

/**
* Returns the input element.
* @deprecated Use the 'inputElement' property instead
*/
public getInputElement(): HTMLInputElement | HTMLSelectElement | HTMLElement | undefined {
return this._input;
}

private _syncNegative(): void {
this.querySelectorAll?.(
'sbb-form-error,sbb-mini-button,sbb-popover-trigger,sbb-form-field-clear,sbb-datepicker-next-day,sbb-datepicker-previous-day,sbb-datepicker-toggle,sbb-select,sbb-autocomplete,sbb-autocomplete-grid',
Expand Down
9 changes: 4 additions & 5 deletions src/elements/form-field/form-field/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,10 @@ technology will announce errors when they appear.

## Methods

| Name | Privacy | Description | Parameters | Return | Inherited From |
| ----------------- | ------- | ------------------------------------------------------------------------------------- | ---------- | ------------------------------------------------------------------- | -------------- |
| `clear` | public | Manually clears the input value. It only works for inputs, selects are not supported. | | `void` | |
| `getInputElement` | public | Returns the input element. | | `HTMLInputElement \| HTMLSelectElement \| HTMLElement \| undefined` | |
| `reset` | public | Manually reset the form field. Currently, this only resets the floating label. | | `void` | |
| Name | Privacy | Description | Parameters | Return | Inherited From |
| ------- | ------- | ------------------------------------------------------------------------------------- | ---------- | ------ | -------------- |
| `clear` | public | Manually clears the input value. It only works for inputs, selects are not supported. | | `void` | |
| `reset` | public | Manually reset the form field. Currently, this only resets the floating label. | | `void` | |

## Slots

Expand Down
Loading