Skip to content

feat(datetime-button): add support for opening datetimes in overlays with button #25649

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 46 commits into from
Jul 21, 2022

Conversation

liamdebeasi
Copy link
Contributor

@liamdebeasi liamdebeasi commented Jul 15, 2022

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
    • Some docs updates need to be made in the ionic-docs repo, in a separate PR. See the contributing guide for details.
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue URL: Internal ticket

What is the new behavior?

  • This feature adds support for ensuring that overlays are correctly sized when opening modal/popover from a datetime button.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Note: The modal + datetime tests will not work until #25648 is merged in

@liamdebeasi liamdebeasi marked this pull request as ready for review July 15, 2022 20:04
@liamdebeasi liamdebeasi requested a review from a team July 15, 2022 20:04
@liamdebeasi liamdebeasi changed the base branch from 546-disabled to FW-546 July 19, 2022 15:24
@liamdebeasi
Copy link
Contributor Author

liamdebeasi commented Jul 19, 2022

When using the mutation observer I needed three rafs in order for it to work on my Mac. However, when throttling the CPU I sometimes needed more. There's probably a better way to solve this, but I can't quite think of it at the moment.

@sean-perkins
Copy link
Contributor

I'm good with the internal event pattern then 👍

For the width changes in the grid, I would recommend we set a min width/styles to make the month/year selection match the same width as the date picker. Having the layout not shift when toggling between would be ideal here.

@averyjohnston
Copy link
Contributor

I'm also okay with the ionRender event pattern for now; my immediate thought was also to use a raf in the mutation observer callback, but if that wasn't enough, what we've got now should be okay.

Co-authored-by: Amanda Johnston <90629384+amandaejohnston@users.noreply.github.com>
@liamdebeasi
Copy link
Contributor Author

I found a better way to fix the sizing of the datetime in a less intrusive way. (See latest commits)

@sean-perkins
Copy link
Contributor

Observing that the lower bounds for the min-width is causing clipping in the overlay test (with popover):

Screen Shot 2022-07-20 at 2 14 55 PM

Also, likely unrelated to any of these changes, but there is some odd rendering happening at the bottom of the picker columns in iOS emulation:

Screen Shot 2022-07-20 at 2 15 22 PM

It looks like the top few pixels of text of the columns are rendering above the border that separates the picker column and the actions.

@liamdebeasi
Copy link
Contributor Author

Good catch. The usage in one of the tests was incorrect, resulting in the size/positioning being wrong.


It looks like the top few pixels of text of the columns are rendering above the border that separates the picker column and the actions.

I can repro in main using the popover example in http://localhost:3333/src/components/datetime/test/basic?ionic:mode=ios. Oddly enough I can only reproduce that on desktop Safari -- mobile Safari is fine.

@liamdebeasi liamdebeasi merged commit 9e3d028 into FW-546 Jul 21, 2022
@liamdebeasi liamdebeasi deleted the 546-overlay branch July 21, 2022 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package package: vue @ionic/vue package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants