
How to do that when entering the size of the height or width, set selection manually in the box
or by pressed enter something like this
@richdenis86 Hello. Today I did the same task, I used the method "setData"
@richdenis86 Hello. Today I did the same task, I used the method "setData"
I tried but I did not succeed, can you please explain how you did it? or show code snippet?
<input type="text" class="form-control" onchange="setData()" data-method="setData" id="dataHeight" placeholder="height">
something, like this doesnt work :(
@richdenis86
const setFieldValue = (name, event) => {
const value = parseFloat(event.target.value);
if (cropper() && !isNaN(value)) {
cropper().setData({
...cropper().getData(),
...{ [name]: value }
});
}
};
and view
<Input
value={cropData.width}
type="number"
onChange={value => setFieldValue("width", value)}
/>
may be i don't understand or something wrong? it doesnt work, can you send me html files pls? its very important, [email protected]

@richdenis86 You can see cropper with input
big thank you bro, but when i 'm transfer this code to the html page , getiing error Uncaught TypeError: $image.cropper is not a function,
https://codepen.io/richdenis86/pen/LwZEOZ
i installed it without npm

solved,and finally its worked! thank you @oskvortsov !!! :)