Skip to content

Commit

Permalink
fix(sbb-form-field): remove deprecated getInputElement() method
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The `getInputElement()` method of the `sbb-form-field`
has been removed. Use inputElement property as alternative.
  • Loading branch information
jeripeierSBB committed Nov 20, 2024
1 parent 126a4ab commit cd6cb08
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
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

0 comments on commit cd6cb08

Please sign in to comment.