diff --git a/scripts/update-docs.sh b/scripts/update-docs.sh
index b7331d3..c17de7f 100644
--- a/scripts/update-docs.sh
+++ b/scripts/update-docs.sh
@@ -20,11 +20,11 @@ done
# create a commit, only if there are changes
if git diff --quiet docs/$output_file; then
- echo "No component documentation changes detected"
+ echo -e "No new component README files detected.\nProceeding with push"
exit 0
else
commit_msg="chore(docs): auto-update to component docs"
- echo "Changes detected, committing updated docs/$output_file file..."
+ echo "New README files detected, committing updated docs/$output_file file..."
git add docs/$output_file && git commit -m "$commit_msg" --no-verify && echo "Commit finished, proceeding with push"
fi
diff --git a/src/components/Dropdown/PdapDropdown.spec.ts b/src/components/Dropdown/PdapDropdown.spec.ts
index 803bca6..2fd6976 100644
--- a/src/components/Dropdown/PdapDropdown.spec.ts
+++ b/src/components/Dropdown/PdapDropdown.spec.ts
@@ -10,6 +10,9 @@ let content;
describe('PdapDropdown', () => {
beforeEach(() => {
wrapper = shallowMount(PdapDropdown, {
+ props: {
+ dropdownId: 'test-dropdown',
+ },
slots: {
trigger: 'Toggle Dropdown',
content: '
',
@@ -48,6 +51,7 @@ describe('PdapDropdown', () => {
wrapper = shallowMount(PdapDropdown, {
props: {
disabled: true,
+ dropdownId: 'test-dropdown',
},
slots: {
trigger: 'Toggle Dropdown',
@@ -67,6 +71,7 @@ describe('PdapDropdown', () => {
it('should respect the triggerOn prop', async () => {
wrapper = shallowMount(PdapDropdown, {
props: {
+ dropdownId: 'test-dropdown',
triggerOn: PdapDropdownTriggerType.HOVER,
},
slots: {
diff --git a/src/components/Dropdown/PdapDropdown.vue b/src/components/Dropdown/PdapDropdown.vue
index 92e7937..c4ce6c7 100644
--- a/src/components/Dropdown/PdapDropdown.vue
+++ b/src/components/Dropdown/PdapDropdown.vue
@@ -57,7 +57,6 @@ const props = withDefaults(defineProps(), {
const emit = defineEmits(['update:open', 'press']);
// Vars
-const dropdownId = 'pdap-dropdown';
const contentRef = ref(null);
const dropdownRef = ref(null);
const open = ref(props.defaultOpen);
diff --git a/src/components/Dropdown/README.md b/src/components/Dropdown/README.md
index f4a52d0..24eae08 100644
--- a/src/components/Dropdown/README.md
+++ b/src/components/Dropdown/README.md
@@ -4,11 +4,12 @@ The Dropdown component is an accessible dropdown menu that can be triggered by c
## Props
-| name | required? | types | description | default |
-| ------------- | --------- | -------------------- | -------------------------------------------------- | --------- |
-| `defaultOpen` | no | `boolean` | Whether the dropdown is initially open | `false` |
-| `disabled` | no | `boolean` | Whether the dropdown should be disabled | `false` |
-| `triggerType` | no | `"press" \| "hover"` | The type of event that should trigger the dropdown | `"press"` |
+| name | required? | types | description | default |
+| ------------- | --------- | -------------------- | -------------------------------------------------- | -------------- |
+| `defaultOpen` | no | `boolean` | Whether the dropdown is initially open | `false` |
+| `disabled` | no | `boolean` | Whether the dropdown should be disabled | `false` |
+| `dropdownId` | yes | `string` | ID of dropdown content, must be unique | none, required |
+| `triggerType` | no | `"press" \| "hover"` | The type of event that should trigger the dropdown | `"press"` |
## Slots
diff --git a/src/components/Dropdown/__snapshots__/PdapDropdown.spec.ts.snap b/src/components/Dropdown/__snapshots__/PdapDropdown.spec.ts.snap
index 3e253b3..255209b 100644
--- a/src/components/Dropdown/__snapshots__/PdapDropdown.spec.ts.snap
+++ b/src/components/Dropdown/__snapshots__/PdapDropdown.spec.ts.snap
@@ -2,9 +2,9 @@
exports[`PdapDropdown > should be accessible with keyboard 1`] = `
-
+
-
+
- Option 1
- Option 2
@@ -17,9 +17,9 @@ exports[`PdapDropdown > should be accessible with keyboard 1`] = `
exports[`PdapDropdown > should open and close dropdown correctly 1`] = `
-
+
-
+
- Option 1
- Option 2
@@ -32,9 +32,9 @@ exports[`PdapDropdown > should open and close dropdown correctly 1`] = `
exports[`PdapDropdown > should respect disabled prop 1`] = `
-
+
-
+
- Option 1
- Option 2
@@ -47,9 +47,9 @@ exports[`PdapDropdown > should respect disabled prop 1`] = `
exports[`PdapDropdown > should respect the triggerOn prop 1`] = `
-
+
-
+
- Option 1
- Option 2
diff --git a/src/components/Dropdown/types.ts b/src/components/Dropdown/types.ts
index 3acca3d..1f43dc9 100644
--- a/src/components/Dropdown/types.ts
+++ b/src/components/Dropdown/types.ts
@@ -6,5 +6,6 @@ export enum PdapDropdownTriggerType {
export interface PdapDropdownProps {
defaultOpen?: boolean;
disabled?: boolean;
+ dropdownId: string;
triggerOn?: PdapDropdownTriggerType;
}
diff --git a/src/demo/pages/ComponentDemo.vue b/src/demo/pages/ComponentDemo.vue
index e7deb6e..25b42db 100644
--- a/src/demo/pages/ComponentDemo.vue
+++ b/src/demo/pages/ComponentDemo.vue
@@ -112,6 +112,7 @@
Dropdown: click or press to open
(dropDownPressIsOpen = isOpen)"
>
@@ -155,6 +156,7 @@
(dropDownHoverIsOpen = isOpen)"
@press="() => buttonAlert('Hello from top-level button')"