Range input on mouse leave


Topic: Range input on mouse leave

univlearning pro asked 5 years ago

Hi,

I would like to know if it is posible to get the value of my range input when the mouse leave the range input. I mean, I don't care about getting the values while the mouse is slidding, but I want the value when the user leave the clic.

Thanks a lot.


Konrad Stępień staff answered 5 years ago

Hi @univlearning,

Can you try of code below?

HTML

<mdb-range-input
  default="true"
  id="range"
  min="0"
  max="100"
  (rangeValueChange)="onRangeValueChange($event.value)"
  (mouseup)="onRangeMouseUp()"
></mdb-range-input>

TS

import { Component } from '@angular/core';
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss'],
})
export class AppComponent{
  rangeValue = 0;

  onRangeValueChange(value: number) {
    this.rangeValue = value;
  }

  onRangeMouseUp() {
    console.log(this.rangeValue);
  }
}

Best, Konrad.


univlearning pro commented 5 years ago

Hi,

It works great!

Thanks a lot


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 8.10.1
  • Device: All
  • Browser: All
  • OS: All
  • Provided sample code: No
  • Provided link: No