Skip to content
Snippets Groups Projects

Fix link togglers jumping to top

1 unresolved thread

What does this MR do?

  • e.preventDefault() only for a and button. We want the checkbox to do its own thing.

Using <button> is semantically more accurate for the usage and we don't need the previous e.preventDefault()

Are there points in the code the reviewer needs to double check?

Togglers to check:

Why was this MR needed?

  • We used a tags with empty fragment href="#" which would jump you to the top of the page when clicked

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #29414 (closed)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
21 21 // %a.js-toggle-button
22 22 // %div.js-toggle-content
23 23 //
24 $('body').on('click', '.js-toggle-button', function() {
24 $('body').on('click', '.js-toggle-button', function(e) {
25 25 toggleContainer($(this).closest('.js-toggle-container'));
26
27 const targetTag = e.target.tagName.toLowerCase();
28 if (targetTag === 'a' || targetTag === 'button') {
  • LGTM :thumbsup:

  • Phil Hughes assigned to @alfredo1

    assigned to @alfredo1

  • username-removed-892863 restored source branch 29414-fix-toggle-disccusion-link-jump-pick-into-9-0

    restored source branch 29414-fix-toggle-disccusion-link-jump-pick-into-9-0

  • username-removed-408881 Approved this merge request

    Approved this merge request

  • username-removed-408881 enabled an automatic merge when the pipeline for f97c1d10 succeeds

    enabled an automatic merge when the pipeline for f97c1d10 succeeds

  • mentioned in commit 8fddde5b

  • LGTM :sparkles:

  • Picked into 9-0-stable, will go into 9.0.0-rc3

  • username-removed-423915 removed ~149423 label

    removed ~149423 label

  • mentioned in commit d4c8e847

  • mentioned in merge request !10126 (merged)

  • Please register or sign in to reply
    Loading