Thumbnail navigation arrows broken

Created on 27 March 2024, 3 months ago
Updated 12 April 2024, 2 months ago

Problem/Motivation

I'm still looking into what exactly is going on, but I have thumbnail nav for a main slider and everything is working except the previous arrow.

I changed the splide/base library to point to the un-minified code and started commenting things out to see if it was a core Splide bug or a library bug, and I tracked it down to this line in splide.base.js in the instance.on('arrows:mounted') handler:

if (o.type === 'slide') {
  go(prev, 0, end);
  go(next, end, 0);
}

If I comment that out everything works just fine. I'll keep looking but just in case anyone knows what that is actually supposed to be doing and why removing it fixes the arrows it could save me some time.

๐Ÿ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States KarlShea Minneapolis, ๐Ÿ‡บ๐Ÿ‡ธ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @KarlShea
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ravi kant Jaipur

    I am also getting same issue.
    I try to figure out with admin configs but issue did not solved.
    Also i try with suggestion of @KarlShea, but this also not solving issue for me.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States KarlShea Minneapolis, ๐Ÿ‡บ๐Ÿ‡ธ

    @ravi did you change base in splide.libraries.yml to point to js/src/splide.base.js and clear caches after commenting out that line?

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States KarlShea Minneapolis, ๐Ÿ‡บ๐Ÿ‡ธ

    I think I figured it out:

    var go = function (el, source, dest) {  
    
      // This gets captured in scope, so isn't recalculated on each click which means that the current index is always zero.
      var index = instance.Components.Controller.getIndex();
    
      $.on(el, 'click.' + NICK, function () {
    
        // If it's moved here instead, it's recalculated on each click and seems to work as intended.
        var index = instance.Components.Controller.getIndex();
    
        if (index === source) {
          instance.go(dest);
        }
      });
    };
    

    That being said, it looks like this block of code is forcing rewind behavior. I didn't notice because I had rewind enabled in my optionset, but if I turn off rewind this code is still forcing it. Rewind is handled by the Splide library itself, so if that behavior is desired it can be enabled without this code.

    @gausarts any thoughts?

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States KarlShea Minneapolis, ๐Ÿ‡บ๐Ÿ‡ธ

    Looks like this was added in 3691c830: "Fixed for unwanted asnavfor clone styling."

  • Pipeline finished with Success
    3 months ago
    Total: 157s
    #131200
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7 updated deps
    last update 3 months ago
    18 pass
  • Pipeline finished with Success
    3 months ago
    Total: 254s
    #131211
  • Status changed to Needs review 3 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ravi kant Jaipur

    Thank you @KarlShea
    The issue solved for me and i have created MR !5.

  • ๐Ÿ‡ฎ๐Ÿ‡ฉIndonesia gausarts

    Thank you

    @KarlShea, you are correct.

    It was a new 2.0.3 module feature to remove disabled arrows/ buttons specific for Slide, mostly related to Splidebox.

    Unfortunately, poorly executed.

    Honesty, I didn't know rewind was what I was looking. My mindset was it was autoplay-related option :)

    But if it does the job as you said, removing the offending line is the correct one.

    @ravi kant, libraries definition change was only for debug purposes IMHO.

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7 updated deps
    last update 3 months ago
    18 pass
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States KarlShea Minneapolis, ๐Ÿ‡บ๐Ÿ‡ธ

    @gausarts reverted libraries change and removed references to the old function. There might be other things to adjust to fix the original issue you were fixing?

  • Pipeline finished with Success
    3 months ago
    Total: 163s
    #131945
  • Status changed to RTBC 3 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ฉIndonesia gausarts

    @KarlShea, thank you.

    Removing the offending lines should be good. Hopefully rewind does the job, but not crucial.

    OOT, I am just losing my Drupal permissions to give proper credits to your or others' authorships.

    Previously I could tick you as an option for the author, but now I couldn't. I haven't got a chance to search nor report this issue to d.o. as it makes no sense if maintainers who should be able to commit and give credits to authors like you are no longer seeing you or others as an option for authors. I thought it was a temporary miss, but has been a while, though.

    I saw Author column before like this:
    https://www.drupal.org/files/GitAttributionUI_0.png โ†’
    https://www.drupal.org/docs/develop/issues/issue-procedures-and-etiquett... โ†’

    But now I don't see it like in my screenshot.
    Please allow me some time to report about this credit issue, or kindly shed the light in case I missed the obvious with recent d.o. changes.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States KarlShea Minneapolis, ๐Ÿ‡บ๐Ÿ‡ธ

    @gausarts I'm not too worried about it, but yeah that does seem weird. Maybe merging the MR will automatically do it? I'm not sure.

    Although you probably need to build the minified JS anyways so the MR flow probably doesn't work with this module that well?

  • Status changed to Needs work 3 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ฉIndonesia gausarts

    > Maybe merging the MR will automatically do it?
    That's it. Just found the relevant issue:
    https://www.drupal.org/project/drupalorg/issues/3177220 ๐Ÿ“Œ Remove commit author radios in the "Credit & committing" section. Fixed

    But then, gitlab MR appears to be unlinked from regular commit pushes when not using MR for old commits. Not sure :)

    Yes, we should update the minified, as well. Or you can use this online service which I normally use since mostly finer than offline ones: https://jscompress.com

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States KarlShea Minneapolis, ๐Ÿ‡บ๐Ÿ‡ธ

    Unrelated to this issue, but after 10.1 Drupal can minify itself: https://www.drupal.org/node/3305725 โ†’

    Do you think it makes sense to remove the minifed JS from this module and let Drupal handle it?

  • ๐Ÿ‡ฎ๐Ÿ‡ฉIndonesia gausarts

    Good to hear it, thank you.

    When core has it builtin, we should remove our own minification. It will have more benefits like easy debug without hustles, and less maintenance.

    Perhaps when min core requirements D10, or even sooner whenever I got a chance to update them since I can always to D10 just as easily. Patches are welcome at another thread.

    The only reason I minified all my JS is because I don't always use advagg, and core didn't have it till D10 :)

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7 updated deps
    last update 3 months ago
    18 pass
  • Status changed to Needs review 3 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States KarlShea Minneapolis, ๐Ÿ‡บ๐Ÿ‡ธ
  • Pipeline finished with Success
    3 months ago
    Total: 164s
    #132069
  • Pipeline finished with Skipped
    3 months ago
    #132563
  • Status changed to Fixed 3 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ฉIndonesia gausarts

    @KarlShea, merged, thank you.
    @ravikant, thank you anyway.

    IIRC, this is my first time using a cellphone to commit an MR :)

    There is always a first time for everything.

    I hope I did it right, thus having credited @KarlShea alone since I can no longer assign author to choose one from two. Previously I could credit many, and chose one author, but not now, so I am a bit careful with this new UI stuffs till I figure it out any better.

    Feel free to CMIIW.

    @KarlShea, please confirm if you got your credit correctly.

  • Status changed to Active 3 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ฉIndonesia gausarts

    Oh, no.

    I credited @KarlShea alone, and it did merged @KarlShea's MR, only now authored by @ravikant?

    I am sorry, I don't understand this MR selection stuff as predicted. The select options are not very clear to choose from even after correct credit.

    We'll need a revert?

    • gausarts โ†’ committed f100c2e4 on 2.0.x
      Revert "Issue #3436319 by KarlShea: Thumbnail navigation arrows broken...
  • ๐Ÿ‡ฎ๐Ÿ‡ฉIndonesia gausarts

    @KarlShea, I tried reverting this MR for my education purposes so to get the correct authorship credit.

    And see if I can choose your new MR to get the correct credit about which I doubted if using MR !5 which was initially authored by @ravikant?

    @KarlShea, I suspected you might need to create MR !6 or so on your own so to get correct authorship credit, not using MR!5 which was authored by @ravikant?

    If not, do not hesitate to shed the light.
    Thank you.

  • Status changed to Needs work 3 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ฉIndonesia gausarts
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7 updated deps
    last update 3 months ago
    18 pass
  • Status changed to Needs review 3 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States KarlShea Minneapolis, ๐Ÿ‡บ๐Ÿ‡ธ

    I'm not really concerned about the issue credit, but if you're trying to figure it out I found this on slack: https://drupal.slack.com/archives/C1BMUQ9U6/p1704365359171499?thread_ts=...

    If you use the Merge button within the issue, itโ€™ll. use the values set in the credit table, including the author.

    Apparently it's a button within the issue below the credit table?

  • Pipeline finished with Success
    3 months ago
    Total: 163s
    #132762
  • Pipeline finished with Skipped
    3 months ago
    #132793
  • Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7 updated deps
    last update 3 months ago
    Not currently mergeable.
  • Pipeline finished with Skipped
    3 months ago
    #132794
  • Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7 updated deps
    last update 3 months ago
    Not currently mergeable.
  • Pipeline finished with Skipped
    3 months ago
    #132797
  • Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7 updated deps
    last update 3 months ago
    Not currently mergeable.
  • ๐Ÿ‡ฎ๐Ÿ‡ฉIndonesia gausarts

    Hm, weird indeed :)

    As seen in the commit message #16 I did credit @KarlShea alone, and under Merge I select the first option which was correct. But the author was still @ravikant.

    However based on the previous #16 commit, I tend to think, the first author of an MR always got the authorship credit even though I have excluded @ravikant and my name from the credit table.

    > I'm not really concerned about the issue credit...
    Got it, thanks. I am just not comfortable to give incorrect credits with this new system :)

    I merged your MR!6 now, but the system failed even though I had reverted the #16 commit. See screenshot and the previous system message exactly before this comment.

    Maybe I'll need to use CLI later, but then I have no other way to put --author line for commit message copy/pasta as mentioned in the core issue above.

    While I know you are fine with credits, however I am more concerned about the new system byproduct so that I could give proper credits later on. I will see if anyone had this issue, and commit it using CLI if anything failed.

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7 updated deps
    last update 3 months ago
    18 pass
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7 updated deps
    last update 3 months ago
    18 pass
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7 updated deps
    last update 3 months ago
    18 pass
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States KarlShea Minneapolis, ๐Ÿ‡บ๐Ÿ‡ธ

    From what I've been reading, the commit author doesn't matter with regards to issue credits, that's why they removed the author radio buttons in the credits table.

  • Pipeline finished with Success
    3 months ago
    Total: 166s
    #132813
  • Pipeline finished with Skipped
    3 months ago
    #132826
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7 updated deps
    last update 3 months ago
    18 pass
  • ๐Ÿ‡ฎ๐Ÿ‡ฉIndonesia gausarts

    > the commit author doesn't matter with regards to issue credits
    My, this is truly relieving, but also shocking to me :)

    Because then it was the opposite of previous system when authorship matters and determines the authorship credit.

    The merge looks good now, thanks.

  • Status changed to Fixed 3 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ฉIndonesia gausarts

    I don't quite understand #26 :)

    I thought it would say ... authored by KarlShea.

    But I assumed it is the way it is, correct?

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States KarlShea Minneapolis, ๐Ÿ‡บ๐Ÿ‡ธ

    #26 just means that it's the commit author, because I cherry-picked the squashed merge commit which had Ravi as the author. It doesn't influence issue credits.

    This issue is showing up as credited on my user account, I think if you merge from the issue after picking users in the credits table that's all that matters now.

  • ๐Ÿ‡ฎ๐Ÿ‡ฉIndonesia gausarts

    Noted, thanks.

    I'd love to embrace this new system to ease things up, but so far worried about giving incorrect credits as previously described.

    Your comments help me see this new system better, although honestly I am still a bit confused seeing those MR commit messages conflicting my usual old CLI commit messages :)

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States KarlShea Minneapolis, ๐Ÿ‡บ๐Ÿ‡ธ

    It is definitely an adjustment, after working with the new MR flow awhile I feel like I understand what's going on better but it still feels pretty awkward how things are spread out all over.

    The other thing I wish they'd make way easier is syncing the base branch into the issue branch, it's always a juggle getting origin/2.x and nnn-my-issue-branch/2.x up to date and rebasing everything.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024