Skip to content

Fix unable to collapse/expand board list on mobile

What does this MR do?

This fixes issue #32064 (closed) where clicking on the arrow button doesn't collapse/expand a board list on mobile device.

Root Cause

The arrow button that toggles the board list has a css class of no-drag and this class is being filtered by SortableJS when we init the board to be sortable.

When an element is filtered it will be preventDefault() by default, as per SortableJS' doc.

	filter: ".ignore-elements",  // Selectors that do not lead to dragging (String or Function)
	preventOnFilter: true, // Call `event.preventDefault()` when triggered `filter`

Thus, the collapse toggle button will not emit any event on click when it's being filtered.

Solution

The fix is to simply set preventOnFilter: false to allow the click event to fire. There are two places I could insert the fix:

I've decided to add it to the first file because it seems more natural to have preventOnFilter: false right next to the filter: '.no-drag' option as preventOnFilter acts on selectors in filter.

Note: However this doesn't explain why the button was clickable on desktop but not on mobile in the first place. Perhaps something to do with click vs. touch event handling in SortableJS' codebase. Below are a few fixes on the SortableJS side that might be related, but even after carefully reading through them I still don't quite understand why this only happens on mobile.

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Desktop

  • Chrome
  • Firefox
  • IE 11
  • Edge
  • Safari

Mobile

  • Safari (iOS)
  • Chrome (Android)

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team

Closes #32064 (closed)

Edited by Brian T

Merge request reports