0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-25 05:02:57 +01:00

Use get reference() instead of getReference() in DropdownController

This commit is contained in:
Sage Abdullah 2024-01-23 16:30:24 +00:00 committed by Thibaud Colas
parent f1c4a495cc
commit 0fb80e8aa0

View File

@ -176,7 +176,7 @@ export class DropdownController extends Controller<HTMLElement> {
trigger: 'click',
interactive: true,
...(this.hasOffsetValue && { offset: this.offsetValue }),
getReferenceClientRect: () => this.getReference().getBoundingClientRect(),
getReferenceClientRect: () => this.reference.getBoundingClientRect(),
theme: this.themeValue,
plugins: this.plugins,
onShow() {
@ -207,7 +207,7 @@ export class DropdownController extends Controller<HTMLElement> {
/**
* Use a different reference element depending on the theme.
*/
getReference() {
get reference() {
const toggleParent = this.toggleTarget.parentElement as HTMLElement;
return this.themeValue === 'dropdown-button'
? (toggleParent.parentElement as HTMLElement)