Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions core/src/components/modal/modal.ionic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Comment on lines +34 to +38
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we be using tokens here? I didn't found them in Figma, but was it checked with the UX Team?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we be using tokens here? I didn't found them in Figma, but was it checked with the UX Team?

@OS-giulianasilva well, I did not use them because they are not there :P
--max-width is making usage of it. Will ask about others.


// Sheet Modal
// --------------------------------------------------

Expand Down
4 changes: 4 additions & 0 deletions core/src/components/select-modal/select-modal.ionic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// Ionic Select Modal
// --------------------------------------------------

:host(.in-modal-default) ion-content::part(scroll) {
--padding-bottom: #{globals.$ion-space-400};
}

// Item
// ----------------------------------------------------------------

Expand Down
17 changes: 15 additions & 2 deletions core/src/components/select-modal/select-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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];

Expand Down Expand Up @@ -143,7 +151,12 @@ export class SelectModal implements ComponentInterface {

render() {
return (
<Host class={getIonMode(this)}>
<Host
class={{
[getIonMode(this)]: true,
...this.getModalContextClasses(),
}}
>
<ion-header>
<ion-toolbar>
{this.header !== undefined && <ion-title>{this.header}</ion-title>}
Expand Down
Loading