Skip to content
Merged
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
2 changes: 1 addition & 1 deletion core/src/components/buttons/buttons.ionic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// --------------------------------------------------

::slotted(*) .button-clear {
--color: globals.$ion-primitives-neutral-1200;
--color: #{globals.$ion-primitives-neutral-1200};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noticed this while updating the styles.

--background: transparent;
--background-activated: transparent;
--background-focused: transparent;
Expand Down
12 changes: 5 additions & 7 deletions core/src/components/datetime/datetime.common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,14 @@
overflow: hidden;
}

// Calendar / Header / Action Buttons
// Calendar / Footer / Action Buttons
// -----------------------------------

:host .datetime-action-buttons.has-clear-button {
width: 100%;
}

:host .datetime-action-buttons ion-buttons {
display: flex;

justify-content: space-between;
}

:host .datetime-action-buttons ion-buttons,
/**
* The confirm and clear buttons are grouped in a
* container so that they appear on the end opposite
Expand All @@ -178,6 +173,9 @@
display: flex;
}

// Calendar / Header / Action Buttons
// -----------------------------------

/**
* Date/Year button should be on
* the opposite side of the component
Expand Down
16 changes: 16 additions & 0 deletions core/src/components/datetime/datetime.ionic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,19 @@
background-color: globals.$ion-primitives-neutral-100;
color: globals.$ion-primitives-neutral-1200;
}

// Calendar / Footer / Action Buttons
// -----------------------------------

:host .datetime-buttons ion-buttons,
.datetime-action-buttons .datetime-action-buttons-container {
flex-flow: column;
align-items: stretch;
gap: globals.$ion-space-200;
}

:host .datetime-buttons ion-buttons ion-button {
@include globals.typography(globals.$ion-body-action-lg);

min-height: globals.$ion-space-1200;
}
7 changes: 7 additions & 0 deletions core/src/components/datetime/datetime.native.scss
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,10 @@ ion-picker {
--highlight-border-radius: var(--wheel-highlight-border-radius);
--fade-background-rgb: var(--wheel-fade-background-rgb);
}

// Calendar / Footer / Action Buttons
// -----------------------------------

:host .datetime-action-buttons ion-buttons {
justify-content: space-between;
}
3 changes: 3 additions & 0 deletions core/src/components/datetime/datetime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1516,13 +1516,15 @@ export class Datetime implements ComponentInterface {
*/

private renderFooter() {
const theme = getIonTheme(this);
const { disabled, readonly, showDefaultButtons, showClearButton } = this;
/**
* The cancel, clear, and confirm buttons
* should not be interactive if the datetime
* is disabled or readonly.
*/
const isButtonDisabled = disabled || readonly;
const confirmFill = theme === 'ionic' ? 'solid' : undefined;
const hasSlottedButtons = this.el.querySelector('[slot="buttons"]') !== null;
if (!hasSlottedButtons && !showDefaultButtons && !showClearButton) {
return;
Expand Down Expand Up @@ -1578,6 +1580,7 @@ export class Datetime implements ComponentInterface {
color={this.color}
onClick={() => this.confirm(true)}
disabled={isButtonDisabled}
fill={confirmFill}
>
{this.doneText}
</ion-button>
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/datetime/test/basic/datetime.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) =>
});
});

configs().forEach(({ title, screenshot, config }) => {
configs({ modes: ['ios', 'md', 'ionic-md'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('datetime: footer'), () => {
test('should render default buttons', async ({ page }) => {
await page.setContent('<ion-datetime value="2022-05-03" show-default-buttons="true"></ion-datetime>', config);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading