craftcms / craftcms/cms

Redactor 1.1 in Matrix and toolbarFixed enabled causes issues with multiple blocks

Open
#2,699 8 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug severity:minor
Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

Description

When adding Matrick blocks with a Redactor 1.1 field in them and "toolbarFixed": true in the Redactor .json config, the toolbar keeps disappearing, getting stuck on the wrong field, moving to the right when multiple blocks are present on the same page (multiple matrix blocks with instances of Redactor).

I have disabled all other plugins to test this and still get this erratic behavior. The only message in JS console is Double-instantiating a menu button on an element from garnish.js:220 - but that's there on load, before adding any Redactor fields, so I don't think it's related.

If I set toolbarFixed to false, everything works normally - but that's not practical for clients once they put a few lines of text and can't see the menu anymore.

Steps to reproduce
  1. Install Redactor 1.1
  2. Add Redactor to a matrix field
  3. Add toolbarFixed: true to Redactor json config
  4. Add a few matrix blocks, add enough text to extend over page height
  5. Redactor toolbar disappears, moves to right, gets stuck from other matrix blocks
Additional info

Craft version: 3.0.1
PHP version: PHP 7.1.10 (cli) (built: Oct 4 2017 08:54:01)
Database driver & version: MySQL 5.7.19
Plugins & versions: Redactor 1.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with Redactor 1.1 inside multiple Matrix blocks and toolbarFixed: true, then compare behavior with it disabled. Start by checking the garnish.js:220 console message and the Redactor/Matrix toolbar behavior; done means the toolbar stays visible and attached to the correct field as blocks and content grow.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, php
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.