Conversation
02d5569 to
e4b0293
Compare
b34b96a to
1682559
Compare
| </oc-button> | ||
| <context-menu-quick-action | ||
| ref="contextMenuButtonRef" | ||
| :ref="(el: any) => (contextMenuDrops[item.id] = el?.drop)" |
There was a problem hiding this comment.
any cast can be removed when we switch to script setup. But I don't want to bloat this already big PR even more.
| it('should show the context menu on right click', async () => { | ||
| const groups = getGroupMocks() | ||
| const spyDisplayPositionedDropdown = vi.mocked(displayPositionedDropdown) | ||
| const { wrapper } = getWrapper({ mountType: mount, groups }) | ||
| await wrapper.find(`[data-item-id="${groups[0].id}"]`).trigger('contextmenu') | ||
| expect(spyDisplayPositionedDropdown).toHaveBeenCalledTimes(1) | ||
| }) | ||
| it('should show the context menu on context menu button click', async () => { | ||
| const groups = getGroupMocks() | ||
| const spyDisplayPositionedDropdown = vi.mocked(displayPositionedDropdown) | ||
| const { wrapper } = getWrapper({ mountType: mount, groups }) | ||
| await wrapper.find('.groups-table-btn-action-dropdown').trigger('click') | ||
| expect(spyDisplayPositionedDropdown).toHaveBeenCalledTimes(1) | ||
| }) |
There was a problem hiding this comment.
We can't unit test that the drop is being called because the ref to the drop element doesn't exist.
| }, | ||
|
|
||
| methods: { | ||
| cycleRoles(event: KeyboardEvent) { |
There was a problem hiding this comment.
This was broken for the link role dropdown and other drop menus don't have this functionality, hence I decided to remove it.
| expect(wrapper.html()).toMatchSnapshot() | ||
|
|
||
| expect(wrapper.findAll('#oc-files-context-menu > ul').length).toEqual(menuSections.length) | ||
| expect(wrapper.findAll('.oc-files-context-action-drop').length).toEqual(3) |
There was a problem hiding this comment.
Drop menus are not rendered initially anymore.
f290db3 to
82fc531
Compare
kulmann
left a comment
There was a problem hiding this comment.
Oof size is large 😅 I didn't succeed in trying to trick the ui into weird drop positions. Wow, super nice!
Found one small thing... but debatable: when doing a right-click on a tile or row in the files app and then clicking the three-dots-button of the same element, the context menu doesn't re-render next to the three-dots-button but the already open context menu stays where it was opened via right click.
And additionally what you see in the comments. ;-)
82fc531 to
8915fa4
Compare
We don't use this for other drop menus and it was broken for public links anyways.
3929875 to
3b22063
Compare
Replaces tippy.js with the more modern Floating UI. This results in some breaking changes when using the
OcDropcomponent.OcDropbreaking changespopperOptionshas been removedtargethas been removedoffsetis now supposed to be given as a single digit number and controls the vertical offsettippyhas been removedtoggleeven inmanualmode.Floating UI in general is more lightweight and much more similar to a JS native implementation. It basically offers you a set of helpers to position your floating element correctly, but you have to take care of things like event handling, showing/hiding the floating element etc.
closes #1929