Slide out from right option has no effect

Created on 20 June 2022, over 2 years ago
Updated 19 July 2024, 4 months ago

Problem/Motivation

Setting the options for the side the menu should slide out from has no effect. No matter what this setting is, it slides out from the left.

Steps to reproduce

Install module on Drupal 9 and set option for menu to slide out from right.

🐛 Bug report
Status

Active

Version

4.4

Component

Code

Created by

🇨🇦Canada OMD

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States drupgirl

    +1 can confirm

  • 🇺🇸United States jim.shreds

    workaround for me:

    in your theme directory theme file:
    "offCanvas" => [
    "position"=> "right",
    ]
    is what you are looking to add.

    themename.theme

    themename_preprocess_page(&$variables) {
    $variables['#attached']['drupalSettings']['responsive_menu']['custom'] = [
    'options' => [
    'navbar' => [
    'add' => TRUE,
    'title' => 'This is a test',
    ],
    "offCanvas" => [
    "position"=> "right",
    ]
    ],
    'config' => [
    'classNames' => [
    'selected' => 'my-custom-menu--active-trail',
    ],
    ]
    ];
    }

  • 🇩🇪Germany vistree

    Hi, the solution from @jim.shreds does not work for me. I tried:

    /**
     * Implements hook_preprocess_page().
     */
    function ditrare_preprocess_page(&$variables) {
      $variables['#attached']['drupalSettings']['responsive_menu']['custom'] = [
        'options' => [
          'navbar' => [
            'add' => TRUE,
            'title' => 'This is a test',
          ],
          "offCanvas" => [
            "position"=> "left",
          ]
        ],
        'config' => [
          'classNames' => [
            'selected' => 'my-custom-menu--active-trail',
          ],
        ]
      ];
    }
    

    What I really want is to use the mmenu option left-front or right-front - so that the offcanvas is overlaying the content instead of moving the content from the side to make space for the offcanvas menu.

    Should the "offCanvas" option work within theme-page-hook? + Should the position: right-front work?

  • First commit to issue fork.
  • 🇮🇳India rishu_kumar

    rishu_kumar changed the visibility of the branch 3291568-slide-out-from to hidden.

  • 🇮🇳India rishu_kumar

    rishu_kumar changed the visibility of the branch 3291568-slide-out-from to active.

Production build 0.71.5 2024