Setting up a single Material Design Component is easy. For instance,
import { MDCRipple } from "@material/ripple";
const iconButtonRipple = new MDCRipple(document.querySelector(".mdc-icon-button"));
iconButtonRipple.unbounded = true;
But when dealing with multiple components, the MDC documentation suggests using querySelectorAll
like so:
const iconButtonRipple = [].map.call(
document.querySelectorAll(".mdc-icon-button"),
function (el) {
return new MDCRipple(el);
}
);
Unfortunately, this method doesn't seem to work for me and I'm unsure where to include the
iconButtonRipple.unbounded = true
line in all of this. The only solution I've found is to individually assign a unique class to each icon button and initialize them one by one.
If anyone could assist me in setting this up as per the documentation's recommendation, it would be greatly appreciated.