diff --git a/core/src/components/modal/modal.ionic.scss b/core/src/components/modal/modal.ionic.scss index 80244c5ba68..30306fce969 100644 --- a/core/src/components/modal/modal.ionic.scss +++ b/core/src/components/modal/modal.ionic.scss @@ -27,6 +27,16 @@ --border-radius: #{globals.$ion-border-radius-0}; } +// Default Modal +// -------------------------------------------------- + +// Modal when inside a select default-modal +:host(.select-modal.modal-default) { + --max-height: 45%; + --max-width: calc(100% - (#{globals.$ion-space-400} * 2)); + --min-height: 340px; +} + // Sheet Modal // -------------------------------------------------- diff --git a/core/src/components/select-modal/select-modal.ionic.scss b/core/src/components/select-modal/select-modal.ionic.scss index cd0df6ce3a9..23d7705b660 100644 --- a/core/src/components/select-modal/select-modal.ionic.scss +++ b/core/src/components/select-modal/select-modal.ionic.scss @@ -4,6 +4,10 @@ // Ionic Select Modal // -------------------------------------------------- +:host(.in-modal-default) ion-content::part(scroll) { + --padding-bottom: #{globals.$ion-space-400}; +} + // Item // ---------------------------------------------------------------- diff --git a/core/src/components/select-modal/select-modal.tsx b/core/src/components/select-modal/select-modal.tsx index 1e61c933fdf..8b4ed90193e 100644 --- a/core/src/components/select-modal/select-modal.tsx +++ b/core/src/components/select-modal/select-modal.tsx @@ -2,7 +2,7 @@ import { getIonMode } from '@global/ionic-global'; import type { ComponentInterface } from '@stencil/core'; import { Component, Element, Host, Prop, forceUpdate, h } from '@stencil/core'; import { safeCall } from '@utils/overlays'; -import { getClassMap } from '@utils/theme'; +import { getClassMap, hostContext } from '@utils/theme'; import type { CheckboxCustomEvent } from '../checkbox/checkbox-interface'; import type { RadioGroupCustomEvent } from '../radio-group/radio-group-interface'; @@ -74,6 +74,14 @@ export class SelectModal implements ComponentInterface { } } + private getModalContextClasses() { + const el = this.el; + return { + 'in-modal-default': hostContext('ion-modal.modal-default', el), + 'in-modal-sheet': hostContext('ion-modal.modal-sheet', el), + }; + } + private renderRadioOptions() { const checked = this.options.filter((o) => o.checked).map((o) => o.value)[0]; @@ -143,7 +151,12 @@ export class SelectModal implements ComponentInterface { render() { return ( - + {this.header !== undefined && {this.header}}