From 9d8f6041c58e0d5ec2cc76e42b0bedf6645c4d49 Mon Sep 17 00:00:00 2001 From: Markus Sanin Date: Fri, 12 Dec 2025 19:41:43 +0100 Subject: [PATCH 1/5] Remove passing component class to calculatePosition --- .../src/components/basic-dropdown.gts | 1 - .../src/utils/calculate-position.ts | 2 -- .../integration/components/basic-dropdown-test.gts | 13 ++++--------- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/ember-basic-dropdown/src/components/basic-dropdown.gts b/ember-basic-dropdown/src/components/basic-dropdown.gts index f1af9c80..33972970 100644 --- a/ember-basic-dropdown/src/components/basic-dropdown.gts +++ b/ember-basic-dropdown/src/components/basic-dropdown.gts @@ -306,7 +306,6 @@ export default class BasicDropdown extends Component { previousVerticalPosition, renderInPlace, matchTriggerWidth, - dropdown: this, }, ); return this.applyReposition(triggerElement, dropdownElement, positionData); diff --git a/ember-basic-dropdown/src/utils/calculate-position.ts b/ember-basic-dropdown/src/utils/calculate-position.ts index ca591764..238843d6 100644 --- a/ember-basic-dropdown/src/utils/calculate-position.ts +++ b/ember-basic-dropdown/src/utils/calculate-position.ts @@ -1,4 +1,3 @@ -import type BasicDropdown from '../components/basic-dropdown.gts'; import type { VerticalPosition, HorizontalPosition } from '../types.ts'; // To avoid breaking the current types export we need this @@ -11,7 +10,6 @@ export interface CalculatePositionOptions { previousHorizontalPosition?: HorizontalPosition | undefined; previousVerticalPosition?: VerticalPosition | undefined; renderInPlace: boolean; - dropdown: BasicDropdown; } export type CalculatePositionResultStyle = { diff --git a/test-app/tests/integration/components/basic-dropdown-test.gts b/test-app/tests/integration/components/basic-dropdown-test.gts index cafc2cb9..6f60d96e 100644 --- a/test-app/tests/integration/components/basic-dropdown-test.gts +++ b/test-app/tests/integration/components/basic-dropdown-test.gts @@ -1057,13 +1057,8 @@ module('Integration | Component | basic-dropdown', function (hooks) { const self = this; assert.expect(4); - this.calculatePosition = function ( - _triggerElement, - _dropdownElement, - _destinationElement, - { dropdown }, - ) { - assert.ok(dropdown, 'dropdown should be passed to the component'); + this.calculatePosition = function () { + assert.ok('custom calculatePosition was passed to the component'); return { horizontalPosition: 'right', verticalPosition: 'above', @@ -1118,9 +1113,9 @@ module('Integration | Component | basic-dropdown', function (hooks) { _triggerElement, _dropdownElement, _destinationElement, - { dropdown, renderInPlace }, + { renderInPlace }, ) { - assert.ok(dropdown, 'dropdown should be passed to the component'); + assert.ok(renderInPlace, 'custom calculatePosition with renderInPlace was passed to the component'); if (renderInPlace) { return { horizontalPosition: 'right', From e4a501ceb891babc06cf842f1766237466dc4cb3 Mon Sep 17 00:00:00 2001 From: Markus Sanin Date: Fri, 12 Dec 2025 19:47:56 +0100 Subject: [PATCH 2/5] Fix lint --- .../tests/integration/components/basic-dropdown-test.gts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test-app/tests/integration/components/basic-dropdown-test.gts b/test-app/tests/integration/components/basic-dropdown-test.gts index 6f60d96e..caf3add5 100644 --- a/test-app/tests/integration/components/basic-dropdown-test.gts +++ b/test-app/tests/integration/components/basic-dropdown-test.gts @@ -1115,7 +1115,10 @@ module('Integration | Component | basic-dropdown', function (hooks) { _destinationElement, { renderInPlace }, ) { - assert.ok(renderInPlace, 'custom calculatePosition with renderInPlace was passed to the component'); + assert.ok( + renderInPlace, + 'custom calculatePosition with renderInPlace was passed to the component', + ); if (renderInPlace) { return { horizontalPosition: 'right', From 93a61bd68a390f6377880c7472175a5e9ab2d7f7 Mon Sep 17 00:00:00 2001 From: Markus Sanin Date: Fri, 12 Dec 2025 19:55:59 +0100 Subject: [PATCH 3/5] Add in docs --- .../templates/public-pages/docs/migrate-8-0-to-9-0.gts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/app/templates/public-pages/docs/migrate-8-0-to-9-0.gts b/docs/app/templates/public-pages/docs/migrate-8-0-to-9-0.gts index 166ec368..53dcf7b0 100644 --- a/docs/app/templates/public-pages/docs/migrate-8-0-to-9-0.gts +++ b/docs/app/templates/public-pages/docs/migrate-8-0-to-9-0.gts @@ -41,6 +41,16 @@ import { LinkTo } from '@ember/routing'; sass-embedded.

+
  • +

    + The + dropdown + option has been removed from + calculatePosition. Previously, this option passed the + current class instance to + calculatePosition. +

    +
  • Passing From 9773eceb520d1bac03d69250a299c377778228f3 Mon Sep 17 00:00:00 2001 From: Markus Sanin Date: Fri, 12 Dec 2025 19:59:16 +0100 Subject: [PATCH 4/5] Improve docs --- docs/app/templates/public-pages/docs/migrate-8-0-to-9-0.gts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/app/templates/public-pages/docs/migrate-8-0-to-9-0.gts b/docs/app/templates/public-pages/docs/migrate-8-0-to-9-0.gts index 53dcf7b0..eedf65af 100644 --- a/docs/app/templates/public-pages/docs/migrate-8-0-to-9-0.gts +++ b/docs/app/templates/public-pages/docs/migrate-8-0-to-9-0.gts @@ -48,7 +48,8 @@ import { LinkTo } from '@ember/routing'; option has been removed from calculatePosition. Previously, this option passed the current class instance to - calculatePosition. + calculatePosition.
    + Note: This option was never documented.

  • From 2e69a63a79dbae8c2d94d55e57f80038c3b6dd81 Mon Sep 17 00:00:00 2001 From: Markus Sanin Date: Fri, 12 Dec 2025 20:00:56 +0100 Subject: [PATCH 5/5] Fix lint --- docs/app/templates/public-pages/docs/migrate-8-0-to-9-0.gts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/app/templates/public-pages/docs/migrate-8-0-to-9-0.gts b/docs/app/templates/public-pages/docs/migrate-8-0-to-9-0.gts index eedf65af..87ce1a9d 100644 --- a/docs/app/templates/public-pages/docs/migrate-8-0-to-9-0.gts +++ b/docs/app/templates/public-pages/docs/migrate-8-0-to-9-0.gts @@ -48,7 +48,7 @@ import { LinkTo } from '@ember/routing'; option has been removed from calculatePosition. Previously, this option passed the current class instance to - calculatePosition.
    + calculatePosition.
    Note: This option was never documented.