Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
mounted() {
const adapter = {
addClass: className => this.$set(this.classes, className, true),
removeClass: className => this.$delete(this.classes, className),
setNativeControlDisabled: disabled =>
this.$refs.controlEl && this.$refs.controlEl.disabled == disabled,
};
// add foundation
this.foundation = new MDCRadioFoundation(adapter);
// add ripple
this.ripple = new RippleBase(this, {
isUnbounded: () => true,
// Radio buttons technically go "active" whenever there is *any* keyboard interaction. This is not the
// UI we desire.
isSurfaceActive: () => false,
registerInteractionHandler: (evt, handler) => {
this.$refs.controlEl.addEventListener(evt, handler, applyPassive());
},
deregisterInteractionHandler: (evt, handler) => {
this.$refs.controlEl.removeEventListener(evt, handler, applyPassive());
},
computeBoundingRect: () => {
return this.$refs.root.getBoundingClientRect();
mounted() {
const adapter = {
addClass: className => this.$set(this.classes, className, true),
removeClass: className => this.$delete(this.classes, className),
setNativeControlDisabled: disabled =>
this.$refs.controlEl && this.$refs.controlEl.disabled == disabled,
};
// add foundation
this.foundation = new MDCRadioFoundation(adapter);
// add ripple
this.ripple = new RippleBase(this, {
isUnbounded: () => true,
// Radio buttons technically go "active" whenever there is *any* keyboard interaction. This is not the
// UI we desire.
isSurfaceActive: () => false,
registerInteractionHandler: (evt, handler) => {
this.$refs.controlEl.addEventListener(evt, handler, applyPassive());
},
deregisterInteractionHandler: (evt, handler) => {
this.$refs.controlEl.removeEventListener(evt, handler, applyPassive());
},
computeBoundingRect: () => {
return this.$refs.root.getBoundingClientRect();