Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions resources/js/components/ui/DragHandle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ onBeforeUnmount(() => {
<button
ref="buttonEl"
type="button"
class="h-full flex items-center justify-center cursor-grab text-gray-400 dark:text-gray-500 hover:text-gray-700 dark:hover:text-gray-400"
:class="{ 'rounded-sm p-1': keyboardReorder }"
class="h-full flex items-center justify-center rounded-sm p-1 cursor-grab text-gray-400 dark:text-gray-500 hover:text-gray-700 dark:hover:text-gray-400"
style="--focus-outline-offset: 2px"
data-drag-handle
:aria-label="ariaLabel"
Expand Down
6 changes: 6 additions & 0 deletions resources/js/tests/components/ui/DragHandle.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ test('default handle keeps the drag-to-reorder label and does not emit on space'
expect(wrapper.emitted('keyboard-reorder')).toBeUndefined();
});

test('the handle is the same size with and without keyboard reorder', () => {
const classes = (keyboardReorder) => mount(DragHandle, { props: { keyboardReorder } }).get('button').classes();

expect(classes(false)).toEqual(classes(true));
});

test('a consumer aria-label wins over the default label', () => {
const wrapper = mount(DragHandle, {
attrs: { 'aria-label': 'Move column' },
Expand Down
Loading