Skip to content

Commit

Permalink
o not use this._uid in EditDropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
dschmidt committed Jan 23, 2023
1 parent 3a51714 commit a3bf55a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
10 changes: 10 additions & 0 deletions packages/design-system/src/components/OcButton/OcButton.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>
<component
:is="type"
:id="id"
v-bind="additionalAttributes"
:aria-label="ariaLabel"
:class="$_ocButton_buttonClass"
Expand All @@ -12,6 +13,7 @@
</template>

<script lang="ts">
import uniqueId from '../../utils/uniqueId'
import { defineComponent } from 'vue'
import { getSizeClass } from '../../utils/sizeClasses'
Expand All @@ -20,6 +22,14 @@ export default defineComponent({
status: 'ready',
release: '1.0.0',
props: {
/**
* The ID of the element.
*/
id: {
type: String,
required: false,
default: () => uniqueId('oc-button-')
},
/**
* The html element used for the button.
* `button, a, router-link`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<template>
<span class="oc-flex oc-flex-middle">
<oc-button :id="editShareBtnId" class="collaborator-edit-dropdown-options-btn" appearance="raw">
<oc-button ref="editShareBtn" class="collaborator-edit-dropdown-options-btn" appearance="raw">
<oc-icon name="more-2" />
</oc-button>
<oc-drop
ref="expirationDateDrop"
:toggle="'#' + editShareBtnId"
:toggle="'#' + editShareBtn.id"
mode="click"
padding-size="small"
>
Expand Down Expand Up @@ -53,7 +53,7 @@
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import { defineComponent, ref } from 'vue'
import { mapGetters } from 'vuex'
import { DateTime } from 'luxon'
Expand All @@ -78,6 +78,13 @@ export default defineComponent({
required: true
}
},
setup() {
const editShareBtn = ref()
return {
editShareBtn
}
},
data: function () {
return {
enteredExpirationDate: null
Expand Down Expand Up @@ -121,10 +128,6 @@ export default defineComponent({
}
]
},
editShareBtnId() {
return 'files-collaborators-edit-button-' + this._uid
},
shareEditOptions() {
return this.$gettext('Context menu of the share')
},
Expand Down

0 comments on commit a3bf55a

Please sign in to comment.