Skip to content

Dual knob IonRange default values in Vue and React #17878

Closed

Description

@michaeltintiuc

When following the usage examples for IonRange and trying to set default values to an object both knobs remain at 0.

I've tested this with the latest versions of ionic/vue and ionic/react.
It seems that the element's value attribute is being set to NaN when an object is passed it.

Interestingly enough I was able to find a temporary solution for Vue:

<template>
  <ion-range ref="range" dual-knobs min="1" max="100" step="1" snaps="true"></ion-range>
</template>

<script>
export default {
  mounted() {
    this.$refs.range.value = { lower: 20, upper: 60 };
  },
}
</script>

Initially reported here: ModusCreateOrg/ionic-vue#83

Activity

  1. added
    package: vue
    package: react
    on Mar 26, 2019
  2. liamdebeasi commented on Mar 26, 2019

    @liamdebeasi
    Contributor

    Hi there,

    Thanks for the issue! Can you provide the output of running ionic info? Additionally, can you provide a code sample or a repo that shows this issue?

    Thanks!

  3. michaeltintiuc commented on Mar 26, 2019

    @michaeltintiuc
    ContributorAuthor

    Hey @liamdebeasi after talking to @brandyscarney this is not an issue. There is no other way of setting the default values. I've updated the usage docs

  4. self-assigned this
    on Mar 29, 2019
  5. ionitron-bot commented on Jun 26, 2019

    @ionitron-bot

    Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

  6. locked and limited conversation to collaborators on Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

package: reactpackage: vue

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions