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.

feat: range, add reference point to start range slider at

See original GitHub issue

Prerequisites

Describe the Feature Request

ion-range shows an active bar which starts from extreme left (0 value) to current knob location.

Very often ion-range needs to have its floor value (or base value) in the center or somewhere else. In these cases, it is required for the active bar to show between the floor value and current knob value, instead of always starting from 0 (extreme left).

Describe the Use Case

A slider to reduce or increase brightness of an image.

Describe Preferred Solution

Adding a ‘floor’ value attribute for ion-range, and then updating the left/right calculation of active bar to start from ‘floor’ value to current knob value (instead of always starting from 0 to current knob value)

Describe Alternatives

No response

Related Code

/main/core/src/components/range/range.tsx, line 424

    const barStart = `${ratioLower * 100}%`;
    const barEnd = `${100 - ratioUpper * 100}%`;

These calculations will need to be updated to start from a floor value (or base value) to current knob value, instead of always starting from 0 (ratioLower is always zero for single knob ion-range).

Additional Information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
liamdebeasicommented, Dec 9, 2021

Thank you! I discussed with the team and we think this would be a good feature to add to Ionic.

0reactions
ionitron-bot[bot]commented, Aug 26, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

<input type="range"> - HTML: HyperText Markup Language
To create a vertical range, wherein the knob slides up and down, set the CSS appearance property to slider-vertical and include the non-standard ......
Read more >
Basic Accessible Range Input (Slider) • REPL • Svelte
A basic reference custom range component -->. 2. <!-- Featuring: onChange events, Custom property theming, Tooltip, A11y keyboard controls + attributes, -->.
Read more >
Recreating the HTML5 range input for Mobile Safari (webkit)?
Magically <input type="range"> works on all mobile devices. You can style the slider & button how ever you like. I've included sample styles...
Read more >
How to Create a Range Slider in HTML + CSS - HubSpot Blog
A range slider is an input where you select a value from a control or sliding bar. We can slide the handlebar to...
Read more >
How to create a “Before & After” image slider with CSS and JS
The second component is the “slider”. To make thing simple, we could just make use of the html “range” input element.
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