Skip to content

Commit 7b151cc

Browse files
authored
fix: Add DOM-based watching for Flexible fields (#4) (#11)
* fix: add DOM-based watching for Flexible fields Nova's global field-changed events are not emitted by fields inside nova-flexible-content layouts. Added fallback DOM watching: - setupDOMWatching(): Listen for native change/input events - loadInitialValuesFromDOM(): Get values directly from DOM elements - findFlexibleContainer(): Locate the Flexible layout wrapper - handleDOMChange(): Process native DOM events - MutationObserver: Detect dynamically added elements - Proper cleanup on unmount * docs: update changelog and version for v1.0.12
1 parent b6f73b6 commit 7b151cc

5 files changed

Lines changed: 199 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22

33
All notable changes to `nova-dependency-container` will be documented in this file.
44

5+
## [1.0.12] - 2025-11-25
6+
7+
### Fixed
8+
- Fixed field change detection inside Flexible layouts where Nova events are not emitted
9+
- Added DOM-based watching as fallback when Nova's global field-changed events don't fire
10+
11+
### Added
12+
- Added `setupDOMWatching()` to listen for native DOM change/input events
13+
- Added `loadInitialValuesFromDOM()` to get field values directly from DOM elements
14+
- Added `findFlexibleContainer()` to locate the Flexible layout wrapper
15+
- Added `handleDOMChange()` to process native DOM events
16+
- Added `MutationObserver` to detect dynamically added elements
17+
18+
### Technical
19+
- Fields inside nova-flexible-content don't emit to Nova's global event bus
20+
- Now watches select/input/textarea elements directly via addEventListener
21+
- Properly cleans up event listeners and MutationObserver on unmount
22+
523
## [1.0.11] - 2025-11-25
624

725
### Fixed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "iamgerwin/nova-dependency-container",
3-
"version": "1.0.11",
3+
"version": "1.0.12",
44
"description": "A Laravel Nova 4 and 5 field container allowing to depend on other fields values",
55
"keywords": [
66
"laravel",

0 commit comments

Comments
 (0)