Actually I've never seen the toggle button anywhere before but the JS error in the console I get with the current RC1 of Gin + Gin Toolbar tells me that there should be a toggle. Which is currently raising the following error.

Uncaught TypeError: Cannot read properties of null (reading 'parentNode')
    at addButtonGin (VM492 frontend_editing.js:233:19)
    at Object.attach (VM492 frontend_editing.js:265:13)
    at VM469 drupal.js:24:24
    at Array.forEach (<anonymous>)
    at Drupal.attachBehaviors (VM469 drupal.js:21:34)
    at VM470 drupal.init.js:24:12
    at HTMLDocument.listener (VM470 drupal.init.js:14:7)

Steps to reproduce after running the following multi-liner, create a new paragraph type and add it to any content type, create a node with that paragraph and visit front-end. Check console, the above error happens.

mkdir my-drupal9-site && \
cd my-drupal9-site && \
ddev config --project-type=drupal9 --docroot=web --create-docroot && \
ddev start && \
ddev composer create "drupal/recommended-project:^9" -y && \
ddev composer require drush/drush drupal/gin:@rc drupal/gin_toolbar:@rc drupal/admin_toolbar drupal/frontend_editing:@rc && \
ddev drush -y site:install --account-name=admin --account-pass=admin && \
ddev drush -y theme:enable gin && \
ddev drush -y config:set system.theme admin gin && \
ddev drush -y en admin_toolbar_tools gin_toolbar frontend_editing && \
ddev drush cr && \
ddev drush uli
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

leymannx created an issue. See original summary.

norman.lol’s picture

Title: Uncaught TypeError: Cannot read properties of null (reading 'parentNode') » Fix Gin toolbar toggle button

norman.lol’s picture

Status: Active » Needs review

This spacer item doesn't seem to exist in current Gin/Gin-Toolbar anymore. Let's simply add the toggle always as last item in the toolbar menu. By that it should also be BC without problems.

norman.lol’s picture

StatusFileSize
new1.08 MB

Screenshot of the visual results of the code change that now show the toggle button as last item in the Gin toolbar menu

norman.lol’s picture

StatusFileSize
new557.33 KB

Works also with older versions of Gin+GinToolbar.

Screenshot of where the toggle icon appears as last item in the Gin toolbar menu

norman.lol’s picture

  • leymannx committed f8b26194 on 1.x
    #3331882 Add toggle as last item in Gin toolbar menu
    
norman.lol’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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