react-component / react-component/slider

handleStyle prop does not overwrite styles

Open
#734 0 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.1k
Forks
768
Avg merge
11d 22h
Merged PRs (30d)
5

Description

If a property exists on the handle, you basically can't overwrite it with a new value.
Example:

<Slider handleStyle={{transform: 'scale(2.0)'}}/>

because there already exists a transform property on the handle

transform: translateX(-50%);

while

<Slider handleStyle={{backgroundColor: 'red'}}/>

works

    background-color: red;
    left: 50%;
    right: auto;
    transform: translateX(-50%);

I haven't delved into the codebase but I'm guessing the handleStyle prop is not overriding the default styles properly.
This seems like a pretty easy fix. I don't mind submitting a PR.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the Slider's handleStyle prop is applied alongside the handle's default styles. Reproduce the scale(2.0) example and compare it with the working backgroundColor case; done means a handleStyle transform replaces the default translateX(-50%) while existing style overrides continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.