Skip to content

Commit

Permalink
refactor(select): deprecate sameWidth and positionStrategy (#791)
Browse files Browse the repository at this point in the history
* refactor(select): deprecate `sameWidth` and `positionStrategy`
Change position strategy from `absolute` to `fixed`.
Closes #789
---------

Co-authored-by: Stamen Stoychev <[email protected]>
Co-authored-by: Damyan Petev <[email protected]>
Co-authored-by: Radoslav Karaivanov <[email protected]>
  • Loading branch information
4 people authored Jun 21, 2023
1 parent bb9f371 commit cecafcd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

### Deprecated

- Select: Removed `sameWidth` and `positinStrategy`. They will be removed in the next major release.

### Added

- Combo: Added `matchDiacritics` to the filtering options property. Defaults to `false`.
Expand Down
2 changes: 1 addition & 1 deletion src/components/select/select.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ describe('Select component', () => {

await elementUpdated(select);

expect(select.positionStrategy).to.eq('absolute');
expect(select.positionStrategy).to.eq('fixed');
expect(select.placement).to.eq('bottom-start');
expect(select.open).to.be.true;

Expand Down
7 changes: 7 additions & 0 deletions src/components/select/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,15 @@ export default class IgcSelectComponent extends EventEmitterMixin<
@property()
public placeholder!: string;

/**
* @deprecated since version 5.0. It will be removed in the next major release.
* @hidden @internal
*/
public override positionStrategy: 'absolute' | 'fixed' = 'fixed';

/**
* Whether the dropdown's width should be the same as the target's one.
* @deprecated since version 5.0. It will be removed in the next major release.
* @attr same-width
*/
@property({ type: Boolean, attribute: 'same-width' })
Expand Down
4 changes: 2 additions & 2 deletions stories/select.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const metadata: Meta<IgcSelectComponent> = {
description: "Sets the component's positioning strategy.",
options: ['absolute', 'fixed'],
control: { type: 'inline-radio' },
defaultValue: 'absolute',
defaultValue: 'fixed',
},
flip: {
type: 'boolean',
Expand Down Expand Up @@ -169,7 +169,7 @@ const metadata: Meta<IgcSelectComponent> = {
keepOpenOnOutsideClick: false,
open: false,
placement: 'bottom-start',
positionStrategy: 'absolute',
positionStrategy: 'fixed',
flip: false,
distance: '0',
sameWidth: true,
Expand Down

0 comments on commit cecafcd

Please sign in to comment.