diff --git a/resources/views/language-switch.blade.php b/resources/views/language-switch.blade.php index e04e108..ad0234d 100644 --- a/resources/views/language-switch.blade.php +++ b/resources/views/language-switch.blade.php @@ -12,6 +12,7 @@ ! $isVisibleOutsidePanels && $isFlagsOnly=> 'bottom', default => 'bottom-end', }; + $maxHeight = $languageSwitch->getMaxHeight(); @endphp
@if ($isVisibleOutsidePanels) diff --git a/resources/views/switch.blade.php b/resources/views/switch.blade.php index 3190871..065b812 100644 --- a/resources/views/switch.blade.php +++ b/resources/views/switch.blade.php @@ -2,6 +2,7 @@ teleport :placement="$placement" :width="$isFlagsOnly ? 'flags-only' : 'fls-dropdown-width'" + :max-height="$maxHeight" class="fi-dropdown fi-user-menu" > diff --git a/src/LanguageSwitch.php b/src/LanguageSwitch.php index 41ab680..a2666ef 100755 --- a/src/LanguageSwitch.php +++ b/src/LanguageSwitch.php @@ -39,6 +39,8 @@ class LanguageSwitch extends Component protected bool | Closure $visibleOutsidePanels = false; + protected string $maxHeight = 'max-content'; + protected Closure | string $renderHook = 'panels::global-search.after'; protected Closure | string | null $userPreferredLocale = null; @@ -174,6 +176,13 @@ public function visible(bool | Closure $insidePanels = true, bool | Closure $out return $this; } + public function maxHeight(string $height): static + { + $this->maxHeight = $height; + + return $this; + } + public function getDisplayLocale(): ?string { return $this->evaluate($this->displayLocale); @@ -270,6 +279,11 @@ public function getPreferredLocale(): string return in_array($locale, $this->getLocales(), true) ? $locale : config('app.locale'); } + public function getMaxHeight(): string + { + return $this->maxHeight; + } + /** * @return array */