Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A way to disable default handle styles #470

Open
artbud opened this issue Jun 21, 2019 · 0 comments
Open

A way to disable default handle styles #470

artbud opened this issue Jun 21, 2019 · 0 comments

Comments

@artbud
Copy link

artbud commented Jun 21, 2019

Overview of the problem

I'm using re-resizable version [5.0.1]

Demo:
https://codesandbox.io/s/strange-raman-kwxsr

Description of the problem

The docs state the following:

#### `handleStyles?: HandleStyles;`

The `handleStyles` property is used to override the style of one or more resize handles.
Only the axis you specify will have its handle style replaced.
If you specify a value for `right` it will completely replace the styles for the `right` resize handle,
but other handle will still use the default styles.

However now passed handleStyles extend the default styles, not override.

Expected behavior

If I opt to style my handle myself, I'd like to only use the handleClasses prop and not worry about default styles. Please see the provided Codesandbox demo.

Actual behavior

This issued was addressed in #139 but the resulting code still extends the styles instead of replacing them.

Proposed solution

If replacing the styles is a breaking change, we could allow passing null in handleStyles to implicitly disable default styles.

Like so:

handleClasses={{ right: 'right-handler' }}
handleStyles={{ right: null }}

Let's discuss the solution and I'll attempt to make a PR with the changes :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant