Open amckean-tbox opened 1 year ago
Hi! I'll soon try to submit a PR to fix this but in the meantime I've patched (with https://github.com/ds300/patch-package) the package in my app, if anyone needs it, here is the patch that works for me:
index 02180f9..c9b33f7 100644
--- a/node_modules/@ui-kitten/components/devsupport/components/measure/measure.component.js
+++ b/node_modules/@ui-kitten/components/devsupport/components/measure/measure.component.js
@@ -42,7 +42,7 @@ const MeasureElement = (props) => {
if (frame.origin.x < window.size.width) {
return frame;
}
- const boundFrame = new type_1.Frame(frame.origin.x - window.size.width, frame.origin.y, frame.size.width, frame.size.height);
+ const boundFrame = new type_1.Frame(frame.origin.x - window.size.width, frame.origin.y, Math.round(frame.size.width), Math.round(frame.size.height));
return bindToWindow(boundFrame, window);
};
const onUIManagerMeasure = (x, y, w, h) => {
@@ -51,7 +51,7 @@ const MeasureElement = (props) => {
}
else {
const originY = props.shouldUseTopInsets ? y + react_native_1.StatusBar.currentHeight || 0 : y;
- const frame = bindToWindow(new type_1.Frame(x, originY, w, h), type_1.Frame.window());
+ const frame = bindToWindow(new type_1.Frame(x, originY, Math.round(w), Math.round(h)), type_1.Frame.window());
props.onMeasure(frame);
}
};
I am seeing vibration on my Modal on some widths. It looks like it vibrating 1 pixel horizontally. Like also described in https://github.com/akveo/react-native-ui-kitten/issues/1681
Could that also be related to this rounding issue? I am running 5.3.1.
Edit: I tested your fork, does not fix my vibrating modal issue.
🐛 Bug Report
When sizing a modal based on screenSize like this
Note: this is also an issue for height
If the resulting number is a decimal number the modal can flicker from the right and after a minute or two leads to an object property storage error in metro, or app crash in production.
To Reproduce
Steps to reproduce the behavior: Set modalWidth to 225.28 to show error
Expected behavior
Expect modal not to flicker, perhaps to handle this case internally? Wrapping the offending number or calc in Math.round() fixes this.
Link to runnable example or repository (highly encouraged)
https://snack.expo.dev/v95Tv2-QT
UI Kitten and Eva version
Environment information