Skip to content

Commit

Permalink
Observe programmatic <textarea> changes
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Mar 6, 2024
1 parent b640cb9 commit 98b779a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- Fixed a bug where `craft\helpers\DateRange::dateIntervalByTimePeriod()` wasn’t accounting for DST changes.
- Fixed a bug where programmatically-updated `<textarea>`s weren’t triggering autosaves. ([craftcms/ckeditor#172](https://github.com/craftcms/ckeditor/issues/172))

## 4.8.1 - 2024-03-05

Expand Down
2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/cp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/cp.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/web/assets/cp/src/js/FormObserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ Craft.FormObserver = Garnish.Base.extend({
_formChanged(record) {
switch (record.type) {
case 'childList':
// maybe a `[name]` node was added/removed
return (
// was this for the text node of a <textarea>?
(record.target.nodeName === 'TEXTAREA' &&
record.target.hasAttribute('name')) ||
// maybe a `[name]` node was added/removed
this._hasNamedNodes(record.addedNodes) ||
this._hasNamedNodes(record.removedNodes)
);
Expand Down

0 comments on commit 98b779a

Please sign in to comment.