Skip to content

Commit 9d8f604

Browse files
committed
Remove passing component class to calculatePosition
1 parent 3bc6847 commit 9d8f604

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

ember-basic-dropdown/src/components/basic-dropdown.gts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,6 @@ export default class BasicDropdown extends Component<BasicDropdownSignature> {
306306
previousVerticalPosition,
307307
renderInPlace,
308308
matchTriggerWidth,
309-
dropdown: this,
310309
},
311310
);
312311
return this.applyReposition(triggerElement, dropdownElement, positionData);

ember-basic-dropdown/src/utils/calculate-position.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type BasicDropdown from '../components/basic-dropdown.gts';
21
import type { VerticalPosition, HorizontalPosition } from '../types.ts';
32

43
// To avoid breaking the current types export we need this
@@ -11,7 +10,6 @@ export interface CalculatePositionOptions {
1110
previousHorizontalPosition?: HorizontalPosition | undefined;
1211
previousVerticalPosition?: VerticalPosition | undefined;
1312
renderInPlace: boolean;
14-
dropdown: BasicDropdown;
1513
}
1614

1715
export type CalculatePositionResultStyle = {

test-app/tests/integration/components/basic-dropdown-test.gts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,13 +1057,8 @@ module('Integration | Component | basic-dropdown', function (hooks) {
10571057
const self = this;
10581058

10591059
assert.expect(4);
1060-
this.calculatePosition = function (
1061-
_triggerElement,
1062-
_dropdownElement,
1063-
_destinationElement,
1064-
{ dropdown },
1065-
) {
1066-
assert.ok(dropdown, 'dropdown should be passed to the component');
1060+
this.calculatePosition = function () {
1061+
assert.ok('custom calculatePosition was passed to the component');
10671062
return {
10681063
horizontalPosition: 'right',
10691064
verticalPosition: 'above',
@@ -1118,9 +1113,9 @@ module('Integration | Component | basic-dropdown', function (hooks) {
11181113
_triggerElement,
11191114
_dropdownElement,
11201115
_destinationElement,
1121-
{ dropdown, renderInPlace },
1116+
{ renderInPlace },
11221117
) {
1123-
assert.ok(dropdown, 'dropdown should be passed to the component');
1118+
assert.ok(renderInPlace, 'custom calculatePosition with renderInPlace was passed to the component');
11241119
if (renderInPlace) {
11251120
return {
11261121
horizontalPosition: 'right',

0 commit comments

Comments
 (0)