Make collection-specific keys for collapsed column state

This commit is contained in:
Andy Smith
2025-10-15 15:28:46 -05:00
parent a1fd09627d
commit f7afd6c939
3 changed files with 7 additions and 4 deletions
@@ -3,6 +3,9 @@ import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static classes = [ "collapsed" ]
static targets = [ "column", "button" ]
static values = {
collection: String
}
connect() {
this.#restoreColumns()
@@ -71,6 +74,6 @@ export default class extends Controller {
}
#localStorageKeyFor(column) {
return `expand-${column.getAttribute("id")}`
return `expand-${this.collectionValue}-${column.getAttribute("id")}`
}
}