Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Endava/BEEQ
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 237f02189bfae05de01825a767db5c7f460069b4
Choose a base ref
..
head repository: Endava/BEEQ
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d01bcbd9ad3c8a27cfc6918a2b28dab4cb2adfb8
Choose a head ref
Showing with 10 additions and 6 deletions.
  1. +10 −6 packages/beeq/src/components/slider/bq-slider.tsx
16 changes: 10 additions & 6 deletions packages/beeq/src/components/slider/bq-slider.tsx
Original file line number Diff line number Diff line change
@@ -329,11 +329,15 @@ export class BqSlider {

private renderInput = (type: 'max' | 'min', value: number, refCallback: (input: HTMLInputElement) => void) => {
// Determine the zIndex value based on the type and the current min and max values.
// If min and max values are the same, set the zIndex of one of them to -1 depending on the type.
const zIndexValue =
(type === 'min' ? this.minValue === this.min : this.maxValue === this.max) && this.minValue === this.maxValue
? '-1'
: '0';
const zIndexValue = (type: 'min' | 'max'): string => {
const zIndex = {
min: this.minValue === this.min && this.maxValue === this.minValue,
max: this.maxValue === this.max && this.minValue === this.maxValue,
};

// If the value of both thumbs is the same as the min or max value, set the zIndex to -1
return zIndex[type] ? '-1' : '0';
};

return (
<input
@@ -343,7 +347,7 @@ export class BqSlider {
true,
'pointer-events-none': this.isRangeType,
}}
style={{ zIndex: zIndexValue }}
style={{ zIndex: zIndexValue(type) }}
disabled={this.disabled}
min={this.min}
max={this.max}