question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[4.0.0] - ion-range - ionBlur changed behavior

See original GitHub issue

Bug Report

Ionic version:

[x] 4.x

Current behavior:

ionBlur is triggered once the user click outside the range

Expected behavior:

It should be triggered once the user release the slider knob as it used to be

Steps to reproduce:

import { Component } from '@angular/core';

@Component({
  template: `
    <ion-range
      min="20"
      max="80"
      step="2"
      (ionFocus)="ionFocus()"
      (ionBlur)="ionBlur()"
    >
      <ion-icon size="small" slot="start" name="sunny"></ion-icon>
      <ion-icon slot="end" name="sunny"></ion-icon>
    </ion-range>
  `
})
export class HomePage {
  ionFocus() {
    console.log('ionFocus');
  }

  ionBlur() {
    console.log('ionBlur');
  }
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
corranthocommented, Mar 9, 2019

Same issue here, we would like to have an event that is triggered when the final value has been chosen, and then, for example, call a web service. ionChange event is fired for any changes but in our case, we want to call the web service only at the end, when the user has selected the wanted value, not for the intermediary values. This was the behaviour of ionBlur before ionic 4.

2reactions
cegbert-wondersigncommented, Feb 15, 2019

I’m having an issue with the same change. It seems that the meaning of the events has changed from Ionic V3 to V4. What I’m really looking for is an event fired during the end event (where you change the pressedKnob property). It seems this is more or less what ionBlur() fired previously.

I tried using (mouseup) and (touchend) but the problem is those events will only fire if the user happens to release the slider over the element (which doesn’t always happen).

Read more comments on GitHub >

github_iconTop Results From Across the Web

[4.0.0] - ion-range - ionBlur changed behavior #17299 - GitHub
I'm having an issue with the same change. It seems that the meaning of the events has changed from Ionic V3 to V4....
Read more >
Ionic 2 range touchend event - Stack Overflow
I tried to add the touchend event manually but the event is ignored. Here´s also a Plunker with the Problem. <ion-range (ionChange)="showVal($event)" (touchend)= ......
Read more >
ion-range: Slider Knob Controls with Labels - Ionic Framework
ion-range lets you select from a range of values by moving the slider. ... The ionChange event emits as the Range knob value...
Read more >
ionic/docs/core.json - UNPKG
By default, buttons are inline blocks, but setting this attribute will change the button to a full-width block element.
Read more >
https://raw.githubusercontent.com/jianlinxyz/ionic...
Bug Fixes * **range:** update the UI when min/max change ... **range:** add ionFocus and ionBlur events ... **range:** create ion-range input ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found