Comments (5)
I noticed that for anything that causes the color picker to reload (state of a prop changes or expo fast load update) the component started to work again. Here's a small workaround that I could recommend when I was working on my project.
const [size, setSize] = useState(30);
const generateNewSize = () => {
// range of possible sizes (can possibly be smaller)
const min = 29;
const max = 31;
// ensures new size is different in order to trigger a reload because the state is now different in the size prop
let newSize = size;
while (newSize === size) {
newSize = Math.random() * (max - min) + min;
}
setSize(newSize);
}
return (
<ColorPicker
style={styles.colorPickerStyle}
color={ThemeObj.bgColor}
onColorChangeComplete={color => {
selectedPickerColor = color;
}}
thumbSize={size}
sliderSize={size}
noSnap={false}
swatches={false}
row={false}
gapSize={1000}
onInteractionStart={generateNewSize}
/>
);
Hopefully, this workaround proves helpful to you and this is eventually patched.
from react-native-wheel-color-picker.
I have the same issue. It's a shame because the frequency of this error makes it unusable in my project. I found assigning the thumb-size and slider size a state variable that changing the state to a slightly different size upon interaction can help but it still occurs.
from react-native-wheel-color-picker.
This problem is still relevant
from react-native-wheel-color-picker.
Hey @dharay that fix works, thanks! good job!
from react-native-wheel-color-picker.
Added prop useNativeLayout in v1.3.0 with some additional checking. That should fix the issue.
See README.md please.
from react-native-wheel-color-picker.
Related Issues (20)
- onColorChangeComplete prop error: Type '(color: any) => void' is not assignable to type '() => void' HOT 2
- canβt hold on the picker point and move it, only moving by press on android HOT 1
- Typescript errors and patch-package fixes HOT 3
- Support for the experimental syntax 'jsx' isn't currently enabled HOT 1
- onColorChangeComplete called thrice when dragging stops HOT 1
- Changing component props and default values not working HOT 1
- how can i change the image HOT 1
- Return wrong hex color code HOT 5
- Not working properly in scrollview HOT 2
- revert() api throwing "Uncaught Error: null is not an object (evaluating 'rgb.r')" HOT 1
- FEATURE REQUEST allow us to style components positions
- Can I disable the input? HOT 3
- Support RTL HOT 3
- Add optional text input box to type the hex color code and update it in the color wheel? HOT 1
- Palette colors doesnt update HOT 1
- Change Swatch Size HOT 4
- When user changes color onColorChange fires multiple times HOT 1
- Add support for alpha/transparency
- Thumb bug on iOS devices HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-wheel-color-picker.