Keep a date picker's and an app bar's settings on their own component
materialDatepicker set its first day, format, min, max and year range in init() without declaring them, and materialAppBar did the same with its resize observer and scroll handler. Alpine writes an undeclared property to the outermost x-data scope, so two pickers inside one page scope (ReStride's plan setup wraps its form in x-data) shared the last one's min and first day, and a second app bar would have taken the first one's observer. Both now declare them; a browser test puts two pickers in an outer scope. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RHoXZSHc8gGpZjFmA5fPc2
This commit is contained in:
co-authored by
Claude Opus 5
parent
8640d815c8
commit
65788d0c61
@@ -11,6 +11,10 @@ document.addEventListener('alpine:init', () => {
|
||||
collapsed: false,
|
||||
height: null,
|
||||
frame: null,
|
||||
// Set in init(). Declared here, or Alpine writes them to the outermost x-data scope,
|
||||
// where a second app bar in the same page scope would take the first one's observer.
|
||||
schedule: null,
|
||||
resizes: null,
|
||||
|
||||
init() {
|
||||
this.measure = this.measure.bind(this)
|
||||
|
||||
Reference in New Issue
Block a user