Files
wallabag-mirror/assets/controllers/materialize/range_controller.js
Yassine Guedidi 57b1cdf4f3 Own Range initialization explicitly under Stimulus with range-field structure
The Materialize dist bundle implicitly called M.Range.init on all
input[type=range] elements. The new range_controller replaces that
implicit call with an explicit Stimulus lifecycle: M.Range.init on
connect and destroy on disconnect.

The three range inputs in the reading settings tab (lineHeight, fontsize,
maxWidth) now carry data-controller="materialize--range" and gain the
canonical .range-field class alongside the existing .input-field, which
is the structure Materialize v1.2.2 expects for its range slider styling.
2026-03-17 00:32:20 +01:00

15 lines
324 B
JavaScript

import { Controller } from '@hotwired/stimulus';
import M from '@materializecss/materialize';
export default class extends Controller {
connect() {
this.instance = M.Range.init(this.element.querySelector('input[type=range]'));
}
disconnect() {
if (this.instance) {
this.instance.destroy();
}
}
}