Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2276 from owncloud/drop-offset
Browse files Browse the repository at this point in the history
Add offset property to the drop component
  • Loading branch information
JammingBen authored Jul 29, 2022
2 parents 77cff03 + 907c99a commit 44f9bb0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/enhancement-drop-offset
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Enhancement: Add offset property to the drop component

We've added an offset property to the drop component to define a custom offset. Also, the max width of drop menus was increased to 400px.

https://github.com/owncloud/web/issues/7335
https://github.com/owncloud/owncloud-design-system/pull/2276
10 changes: 10 additions & 0 deletions src/components/atoms/OcDrop/OcDrop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ export default {
return value.match(/(xsmall|small|medium|large|xlarge|xxlarge|xxxlarge|remove)/)
},
},
/**
* Determines the offset of the drop element. The value can work on both axes by using a string in the form "x, y", such as "50, 20".
*/
offset: {
type: String,
required: false,
default: undefined,
},
},
data() {
return { tippy: null }
Expand Down Expand Up @@ -158,6 +166,8 @@ export default {
interactive: true,
plugins: [hideOnEsc],
theme: "none",
maxWidth: 400,
offset: this.offset,
aria: {
content: "describedby",
},
Expand Down
6 changes: 3 additions & 3 deletions src/components/atoms/OcDrop/__snapshots__/OcDrop.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ exports[`OcDrop tippy renders tippy 1`] = `
data-state="visible"
data-theme="none"
role="tooltip"
style="max-width: 350px; transition-duration: 300ms;"
style="max-width: 400px; transition-duration: 300ms;"
tabindex="-1"
>
<div
Expand Down Expand Up @@ -69,7 +69,7 @@ exports[`OcDrop tippy renders tippy 2`] = `
data-state="hidden"
data-theme="none"
role="tooltip"
style="max-width: 350px; transition-duration: 250ms;"
style="max-width: 400px; transition-duration: 250ms;"
tabindex="-1"
>
<div
Expand Down Expand Up @@ -116,7 +116,7 @@ exports[`OcDrop tippy renders tippy 3`] = `
data-state="visible"
data-theme="none"
role="tooltip"
style="max-width: 350px; transition-duration: 300ms;"
style="max-width: 400px; transition-duration: 300ms;"
tabindex="-1"
>
<div
Expand Down

0 comments on commit 44f9bb0

Please sign in to comment.