Commit Graph

29 Commits

Author SHA1 Message Date
Liam DeBeasi
2a80eb6bd0 fix(popover): dynamic width popover is positioned correctly (#28072)
Issue number: resolves #27190, resolves #24780

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

Popovers with dynamic widths were not being positioned correctly
relative to the trigger element. This was happening because the child
component always had dimensions of 0 x 0. Ionic has logic built-in to
wait for the child components to be rendered, but this was not working
as intended for two reasons:

1. `this.usersElement` was referencing the popover element itself not
the user’s component. When calling `deepReady` on
01fc9b4511/core/src/components/popover/popover.tsx (L477)
we are waiting for the popover to be hydrated, not the child content.
The popover was already hydrated on page load, so this resolves
immediately. However, the child content that was just added to the DOM
has not yet been hydrated, so we aren’t waiting long enough.

This is happening because we return `BaseComponent `from
`attachComponent` which is a reference to the overlay:
01fc9b4511/core/src/utils/framework-delegate.ts (L133)

Other framework delegates return the actual child content:

- Core delegate with controller:
01fc9b4511/core/src/utils/framework-delegate.ts (L35)
(this is part of why the controller popover works but the inline popover
does not)
- React delegate:
01fc9b4511/packages/react/src/framework-delegate.tsx (L31)
- Vue delegate:
01fc9b4511/packages/vue/src/framework-delegate.ts (L45)

2. `attachComponent` is unable to return the correct element currently
because the child content has not been mounted yet in this scenario.
`ionMount` is emitted after `attachComponent` resolves:
01fc9b4511/core/src/components/popover/popover.tsx (L466)

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- `ionMount` is emitted before `attachComponent` runs
- `attachComponent` now consistently returns the child view if present
in the DOM
- Added a test

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

Dev build: `7.3.2-dev.11693321763.15a54694`

---------

Co-authored-by: ionitron <hi@ionicframework.com>
2023-08-31 13:10:36 +00:00
Liam DeBeasi
e8fb9e7328 chore(): sync with main 2023-01-23 13:38:16 -05:00
Amanda Johnston
c2e1ad385d chore(many): replace any types and add tech debt tickets (#26293)
Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
2023-01-06 09:34:55 -06:00
Amanda Johnston
08c0a5520a feat(alert): add ability to use alert inline (#26316) 2022-11-18 13:32:27 -06:00
Liam DeBeasi
3b137ea485 chore(): remove old hasUserDefinedComponent 2022-11-08 18:21:27 +00:00
Liam DeBeasi
b470a307e3 chore(): sync with main 2022-11-08 13:13:46 -05:00
Sean Perkins
bb005956ea fix(overlays): presenting an overlay does not create nested elements (#26154)
Resolves #26117
2022-11-02 16:57:22 -04:00
Sean Perkins
34ca337b8a feat(loading): use loading overlay inline (#26153) 2022-10-24 16:49:17 -04:00
Liam DeBeasi
5676bab316 lint(eslint): migrate to eslint and prettier (#25046) 2022-04-04 11:12:53 -04:00
Liam DeBeasi
ef46eafc94 fix(angular): inline modals now add .ion-page class correctly (#24751)
resolves #24750
2022-02-09 10:57:21 -05:00
Sean Perkins
596aad435b fix(modal): inline modals inherit ion-page styling (#24723)
Resolves #24706

Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
2022-02-08 13:47:51 -05:00
Liam DeBeasi
3be1c3dcd7 feat(modal): modals can now be used inline (#23341)
resolves #20117, resolves #20263
2021-06-01 11:09:40 -04:00
Liam DeBeasi
308fa1c0dd feat(popover): popover can now be used inline (#23231)
BREAKING CHANGE: Converted `ion-popover` to use the Shadow DOM.
2021-05-03 12:02:22 -04:00
Adam Bradley
0de75afbef feat(custom-elements): add experimental custom elements build (#22863)
Co-authored-by: Liam DeBeasi <liamdebeasi@icloud.com>
2021-02-11 12:08:00 -05:00
Manu MA
03c1d19e07 perf(all): minify better by using arrow functions (#18730) 2019-07-10 10:33:33 -04:00
Adam Bradley
8cb266ba34 chore(types): add null checks (#16351) 2018-11-16 22:20:51 -06:00
Manu Mtz.-Almeida
bb1924315e fix(esm): reorganiza exports 2018-09-11 10:54:30 +02:00
Manu Mtz.-Almeida
57d23753a6 feat(all): strong typed ComponentProps 2018-08-27 00:47:10 +02:00
Manu Mtz.-Almeida
2c8bc0433b fix(modal): make sure content is ready
fixes #14969
2018-08-25 16:53:32 +02:00
Manu Mtz.-Almeida
c1b61d0fee chore(): update to ionic-rules/strict 2018-07-29 23:10:38 +02:00
Manu Mtz.-Almeida
92e21a8cf3 fix(all): updated tslint rules to latest 2018-07-29 13:03:47 +02:00
Brandy Carney
a7f1f4daa7 refactor(components): update to use shadow DOM and work with css variables
- updates components to use shadow DOM or scoped if they require css variables
- moves global styles to an external stylesheet that needs to be imported
- adds support for additional colors and removes the Sass loops to generate colors for each component
- several property renames, bug fixes, and test updates

Co-authored-by: Manu Mtz.-Almeida <manu.mtza@gmail.com>
Co-authored-by: Adam Bradley <adambradley25@gmail.com>
Co-authored-by: Cam Wiegert <cam@camwiegert.com>
2018-07-09 12:57:21 -04:00
Manu Mtz.-Almeida
053c375521 refactor(all): allow external imports 2018-04-24 16:12:02 +02:00
Manu Mtz.-Almeida
4ea8881f33 refactor(all): enable strictPropertyInitialization 2018-04-19 18:48:38 +02:00
Manu Mtz.-Almeida
81dc67dda4 chore(): update to stencil 0.7.20 2018-04-10 19:16:32 +02:00
Manu Mtz.-Almeida
fd5c957787 refactor(all): enable ts strict 2018-04-10 02:43:48 +02:00
Manu Mtz.-Almeida
9c789ceac4 fix(angular): ion-back-button 2018-03-29 20:46:13 +02:00
Manu Mtz.-Almeida
a36913e9db refactor(all): data -> componentProps 2018-03-29 18:41:56 +02:00
Manu Mtz.-Almeida
ee27549c84 refactor(dom): attachComponent() 2018-03-21 16:22:59 +01:00