Repository navigation
Conversation
|
|
sean-perkins
left a comment
There was a problem hiding this comment.
Changes look good! +1 to what Liam commented. The datetime basic test template already has an option for enabling dark mode and presenting the datetime in a modal. You may be able to use that test template to have a test that:
- Enables dark mode
- Presents the datetime in a modal
- Captures a screenshot
|
So, the issue here occurs with more than just |
Understood, I'll give modal a peek. Thank you! |
|
@amandaejohnston if you're interested in the bug cause, I've updated the |
averyrousseau
left a comment
There was a problem hiding this comment.
LGTM once the comments are addressed 👍
|
|
||
| test('should not highlight a day until one is selected, with default-buttons', async ({ page }) => { | ||
| await testHighlight(page, 'custom-datetime'); | ||
| await testHighlight(page, 'inline-datetime-no-value'); |
There was a problem hiding this comment.
| await testHighlight(page, 'inline-datetime-no-value'); | |
| await testHighlight(page, 'custom-datetime'); |
I'm assuming this was edited by mistake; this is meant to check a datetime with show-default-buttons set.
There was a problem hiding this comment.
It wasn't by mistake. I ended up passing a value to custom-datetime in order to solve the issue with the changing time that we saw via Zoom. Since these tests (test 1 and test 2) required a datetime that had no value then I ended up switching. However, I'll be reverting this file and moving the test to modal as suggested.
| await page.goto('/src/components/datetime/test/basic'); | ||
|
|
||
| const datetime = page.locator('#custom-datetime'); | ||
| const datetime = page.locator('#inline-datetime-no-value'); |
There was a problem hiding this comment.
| const datetime = page.locator('#inline-datetime-no-value'); | |
| const datetime = page.locator('#custom-datetime'); |
liamdebeasi
left a comment
There was a problem hiding this comment.
The fix itself works well. Great job! A few comments on the tests.
| <h2>Outside "ion-content"</h2> | ||
| <ion-button id="basic-modal">Present modal</ion-button> | ||
| <ion-modal trigger="basic-modal"> | ||
| <h1>Content of doom</h1> |
There was a problem hiding this comment.
We've had that verbiage in another test for a while, so it was likely copy and pasted:
What is the current behavior?
Occurs only when using modal with datetime: text does not update appropriately based on light or dark mode. For example, when using Ionic dark theme, the calendar days does not switch to white.
Issue URL: resolves #26060
What is the new behavior?
Does this introduce a breaking change?
Other information
Recommendation:
datetimeanddatetime-buttonThe bug originates when modal's content is not wrapped by
ion-contentand because the modal renders outside of<main />. Text color is passed to components properly insidemainbecausemainis rendered inside anotherion-content.ion-contentprovides the correct text-color based on light or dark mode.Example of text color working for modal when wrapped by
ion-content:However, there are times that the modal does not require this wrap:
The same bug would have occurred on
popoverif it wasn't for the fact that the component provides the text color.