Skip to content
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

[Popper] Upgrade to popper.js to v2 #21761

Merged
merged 28 commits into from
Oct 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
33fe32f
Initial Commit
joshwooding Jul 11, 2020
42526cf
Virtual element
joshwooding Jul 11, 2020
c512f2a
Missed typescript changes
joshwooding Jul 11, 2020
5579ab3
Write a better modifier merge test
joshwooding Jul 11, 2020
4b4cb34
docs
joshwooding Jul 11, 2020
6a6263a
Fix typescript::formatted
joshwooding Jul 11, 2020
8cac3ab
pls eslint
joshwooding Jul 11, 2020
0980e9c
Fix broken test.
joshwooding Jul 11, 2020
3eac69e
I'd rather have correct types
joshwooding Jul 11, 2020
7c4d680
Turn preventOverflow on by default to mimic previous demo behaviour
joshwooding Jul 11, 2020
adff67c
Fix types
joshwooding Jul 11, 2020
9996b41
All the information
joshwooding Jul 12, 2020
9cdda1e
Remove onFirstUpdate
joshwooding Jul 12, 2020
883fac5
Simplify tests
joshwooding Jul 24, 2020
d9efd4c
Update ignored visual regression tests
joshwooding Jul 25, 2020
282babd
scheduleUpdate -> update
joshwooding Oct 10, 2020
e72ffe7
fix AnchorElTooltips.tsx
joshwooding Oct 10, 2020
5b64bf3
Update faked reference references
joshwooding Oct 10, 2020
9406877
fix test
joshwooding Oct 10, 2020
33bd2e1
Use force update
joshwooding Oct 10, 2020
ba07f4e
review
oliviertassinari Oct 17, 2020
91319fa
fix test
oliviertassinari Oct 18, 2020
3f921c7
review
oliviertassinari Oct 21, 2020
dab2493
more reviews
oliviertassinari Oct 21, 2020
a0c6ea0
Sebastian's review
oliviertassinari Oct 21, 2020
ec27f3b
yarn prettier
oliviertassinari Oct 21, 2020
19acdf5
Merge remote-tracking branch 'upstream/next' into popper-v2
eps1lon Oct 22, 2020
7c0f612
Update docs/src/pages/components/popper/popper.md
eps1lon Oct 22, 2020
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: 5 additions & 5 deletions docs/pages/api-docs/popper.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ import { Popper } from '@material-ui/core';

You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/).

Poppers rely on the 3rd party library [Popper.js](https://popper.js.org/docs/v1/) for positioning.
Poppers rely on the 3rd party library [Popper.js](https://popper.js.org/docs/v2/) for positioning.



## Props

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| <span class="prop-name">anchorEl</span> | <span class="prop-type">HTML element<br>&#124;&nbsp;object<br>&#124;&nbsp;func</span> | | A HTML element, [referenceObject](https://popper.js.org/docs/v1/#referenceObject), or a function that returns either. It's used to set the position of the popper. The return value will passed as the reference object of the Popper instance. |
| <span class="prop-name">anchorEl</span> | <span class="prop-type">HTML element<br>&#124;&nbsp;object<br>&#124;&nbsp;func</span> | | A HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/), or a function that returns either. It's used to set the position of the popper. The return value will passed as the reference object of the Popper instance. |
| <span class="prop-name">children</span> | <span class="prop-type">node<br>&#124;&nbsp;func</span> | | Popper render function or node. |
| <span class="prop-name">container</span> | <span class="prop-type">HTML element<br>&#124;&nbsp;func</span> | | A HTML element or function that returns one. The `container` will have the portal children appended to it.<br>By default, it uses the body of the top-level document object, so it's simply `document.body` most of the time. |
| <span class="prop-name">disablePortal</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | The `children` will be inside the DOM hierarchy of the parent component. |
| <span class="prop-name">keepMounted</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | Always keep the children in the DOM. This prop can be useful in SEO situation or when you want to maximize the responsiveness of the Popper. |
| <span class="prop-name">modifiers</span> | <span class="prop-type">object</span> | | Popper.js is based on a "plugin-like" architecture, most of its features are fully encapsulated "modifiers".<br>A modifier is a function that is called each time Popper.js needs to compute the position of the popper. For this reason, modifiers should be very performant to avoid bottlenecks. To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v1/#modifiers). |
| <span class="prop-name">modifiers</span> | <span class="prop-type">Array&lt;{ data?: object, effect?: func, enabled?: bool, fn?: func, name: any, options?: object, phase?: 'afterMain'<br>&#124;&nbsp;'afterRead'<br>&#124;&nbsp;'afterWrite'<br>&#124;&nbsp;'beforeMain'<br>&#124;&nbsp;'beforeRead'<br>&#124;&nbsp;'beforeWrite'<br>&#124;&nbsp;'main'<br>&#124;&nbsp;'read'<br>&#124;&nbsp;'write', requires?: Array&lt;string&gt;, requiresIfExists?: Array&lt;string&gt; }&gt;</span> | | Popper.js is based on a "plugin-like" architecture, most of its features are fully encapsulated "modifiers".<br>A modifier is a function that is called each time Popper.js needs to compute the position of the popper. For this reason, modifiers should be very performant to avoid bottlenecks. To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/). |
| <span class="prop-name required">open<abbr title="required">*</abbr></span> | <span class="prop-type">bool</span> | | If `true`, the popper is visible. |
| <span class="prop-name">placement</span> | <span class="prop-type">'bottom-end'<br>&#124;&nbsp;'bottom-start'<br>&#124;&nbsp;'bottom'<br>&#124;&nbsp;'left-end'<br>&#124;&nbsp;'left-start'<br>&#124;&nbsp;'left'<br>&#124;&nbsp;'right-end'<br>&#124;&nbsp;'right-start'<br>&#124;&nbsp;'right'<br>&#124;&nbsp;'top-end'<br>&#124;&nbsp;'top-start'<br>&#124;&nbsp;'top'</span> | <span class="prop-default">'bottom'</span> | Popper placement. |
| <span class="prop-name">popperOptions</span> | <span class="prop-type">object</span> | <span class="prop-default">{}</span> | Options provided to the [`popper.js`](https://popper.js.org/docs/v1/) instance. |
| <span class="prop-name">placement</span> | <span class="prop-type">'auto-end'<br>&#124;&nbsp;'auto-start'<br>&#124;&nbsp;'auto'<br>&#124;&nbsp;'bottom-end'<br>&#124;&nbsp;'bottom-start'<br>&#124;&nbsp;'bottom'<br>&#124;&nbsp;'left-end'<br>&#124;&nbsp;'left-start'<br>&#124;&nbsp;'left'<br>&#124;&nbsp;'right-end'<br>&#124;&nbsp;'right-start'<br>&#124;&nbsp;'right'<br>&#124;&nbsp;'top-end'<br>&#124;&nbsp;'top-start'<br>&#124;&nbsp;'top'</span> | <span class="prop-default">'bottom'</span> | Popper placement. |
| <span class="prop-name">popperOptions</span> | <span class="prop-type">{ modifiers?: array, onFirstUpdate?: func, placement?: 'auto-end'<br>&#124;&nbsp;'auto-start'<br>&#124;&nbsp;'auto'<br>&#124;&nbsp;'bottom-end'<br>&#124;&nbsp;'bottom-start'<br>&#124;&nbsp;'bottom'<br>&#124;&nbsp;'left-end'<br>&#124;&nbsp;'left-start'<br>&#124;&nbsp;'left'<br>&#124;&nbsp;'right-end'<br>&#124;&nbsp;'right-start'<br>&#124;&nbsp;'right'<br>&#124;&nbsp;'top-end'<br>&#124;&nbsp;'top-start'<br>&#124;&nbsp;'top', strategy?: 'absolute'<br>&#124;&nbsp;'fixed' }</span> | <span class="prop-default">{}</span> | Options provided to the [`Popper.js`](https://popper.js.org/docs/v2/constructors/#options) instance. |
| <span class="prop-name">popperRef</span> | <span class="prop-type">ref</span> | | A ref that points to the used popper instance. |
| <span class="prop-name">transition</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | Help supporting a react-transition-group/Transition component. |

Expand Down
Loading