Skip to content

Commit

Permalink
ONL-6222:feat: Fix ec-inline-actions where popover is being positione…
Browse files Browse the repository at this point in the history
…d wrongly for sm screens (#977)

* ONL-6222:feat: Fix ec-inline-actions where popover is being positioned wrongly for sm screens

* ONL-6222:feat: Upgrade chameleon version
  • Loading branch information
jmesao authored Nov 15, 2021
1 parent 2f476a9 commit d04525f
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ebury/chameleon-components",
"version": "1.8.3",
"version": "1.8.4",
"main": "src/main.js",
"sideEffects": false,
"author": "Ebury Team (http://labs.ebury.rocks/)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports[`EcInlineActions should render properly the item with the download attr
data-test="ec-stub ec-popover-stub"
offset="10"
placement="bottom-start"
popperoptions="[object Object]"
>
<div
Expand Down Expand Up @@ -43,6 +44,7 @@ exports[`EcInlineActions should render properly the item with the download attr
data-test="ec-stub ec-popover-stub"
offset="10"
placement="bottom-start"
popperoptions="[object Object]"
>
<div
Expand Down Expand Up @@ -81,6 +83,7 @@ exports[`EcInlineActions should render properly when an item was given 1`] = `
data-test="ec-stub ec-popover-stub"
offset="10"
placement="bottom-start"
popperoptions="[object Object]"
>
<div
Expand Down Expand Up @@ -117,6 +120,7 @@ exports[`EcInlineActions should render properly with out the disabled href and d
data-test="ec-stub ec-popover-stub"
offset="10"
placement="bottom-start"
popperoptions="[object Object]"
>
<div
Expand Down Expand Up @@ -153,6 +157,7 @@ exports[`EcInlineActions should render properly with the anchor when the item ha
data-test="ec-stub ec-popover-stub"
offset="10"
placement="bottom-start"
popperoptions="[object Object]"
>
<div
Expand Down Expand Up @@ -190,6 +195,7 @@ exports[`EcInlineActions should render the item disabled when an item was given
data-test="ec-stub ec-popover-stub"
offset="10"
placement="bottom-start"
popperoptions="[object Object]"
>
<div
Expand Down Expand Up @@ -227,6 +233,7 @@ exports[`EcInlineActions should render the item with an icon when a item was giv
data-test="ec-stub ec-popover-stub"
offset="10"
placement="bottom-start"
popperoptions="[object Object]"
>
<div
Expand Down Expand Up @@ -272,6 +279,7 @@ exports[`EcInlineActions should render the item with default popover options 1`]
data-test="ec-stub ec-popover-stub"
offset="10"
placement="bottom-start"
popperoptions="[object Object]"
>
<div
Expand Down Expand Up @@ -317,6 +325,7 @@ exports[`EcInlineActions should render the item with given popover options 1`] =
data-test="ec-stub ec-popover-stub"
offset="20"
placement="top"
popperoptions="[object Object]"
>
<div
Expand Down Expand Up @@ -362,6 +371,7 @@ exports[`EcInlineActions should render with one line break when a different arra
data-test="ec-stub ec-popover-stub"
offset="10"
placement="bottom-start"
popperoptions="[object Object]"
>
<div
Expand Down Expand Up @@ -422,6 +432,7 @@ exports[`EcInlineActions should render with tooltip 1`] = `
data-test="ec-stub ec-popover-stub"
offset="10"
placement="bottom-start"
popperoptions="[object Object]"
>
<div
Expand Down
24 changes: 23 additions & 1 deletion src/components/ec-inline-actions/ec-inline-actions.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<template>
<ec-popover v-bind="getPopoverOptions">
<ec-popover
v-bind="{
popperOptions,
...getPopoverOptions,
}"
>
<slot />
<div
slot="popover"
Expand Down Expand Up @@ -77,6 +82,23 @@ export default {
popoverOptions: {
type: Object,
},
popperModifiers: {
type: Object,
default: null,
},
},
data() {
return {
popperOptions: {
modifiers: {
// https://popper.js.org/popper-documentation.html#modifiers..preventOverflow.priority
preventOverflow: {
priority: ['bottom', 'top'],
},
...this.popperModifiers,
},
},
};
},
computed: {
getPopoverOptions() {
Expand Down

1 comment on commit d04525f

@vercel
Copy link

@vercel vercel bot commented on d04525f Nov 15, 2021

Choose a reason for hiding this comment

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

Please sign in to comment.