redactor icon indicating copy to clipboard operation
redactor copied to clipboard

table cells get class="focus-visible"

Open Metis77 opened this issue 3 years ago • 2 comments

Description

Redactor sets class="focus-visible" to focuses tables inside redactor. If saving now, those classes stay at the table.

Steps to reproduce

  1. add tablet to redacor entry
  2. click a table column -> class="focus-visible" is added
  3. save entry
  4. BUG: class="focus-visible" stays

Maybe Solution: do not add class="focus-visible" on table cells inside redactor.

Additional info

  • Craft version: 4.x
  • PHP version: 8.1
  • Plugins & versions: 3.0.2

Metis77 avatar Jul 23 '22 10:07 Metis77

I am seeing this issue as well in Craft 3.7.55.2:

image

Saving the entry actually saves the focus-visible class.

kruncher avatar Sep 22 '22 16:09 kruncher

Still an issue with Craft 4.2.5.2 and Redactor 3.0.2. This is very annoying if you have styles for .focus-visible in the frontend as well, since you can't get rid of this without editing the HTML manually.

Workaround

Create a HTMLPurifier config inside config/htmlpurifier/something.json:

{
  "Attr.ForbiddenClasses": ["focus-visible"]
}

and enable this config for the Redactor field. After resaving the field, all focus-visible classes should have been removed.

timoschwarzer avatar Oct 04 '22 05:10 timoschwarzer