elad2412/the-new-css-reset

contenteditable rule allows editing when set to false

soniktrooth opened this issue · 2 comments

I believe the rule should look like this:

:where([contenteditable=true]) {
    -moz-user-modify: read-write;
    -webkit-user-modify: read-write;
    overflow-wrap: break-word;
    -webkit-line-break: after-white-space;
}

As per MDN docs: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Editable_content

The attribute must take one of the following values:

- true or an empty string, which indicates that the element is editable.
- false, which indicates that the element is not editable.

By not specifying a value for the attribute you are setting read-write on all elements that have that attribute regardless of it's value.

I believe the correct URL for the MDN page being referred to is https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contenteditable.

Hi @soniktrooth fix with this update on the selector:

:where([contenteditable]:not([contenteditable="false"]))

A new version has been updated (1.6.1).

Issue closed