From 08b3c1d12380ea0161d800716be838db48e6a40f Mon Sep 17 00:00:00 2001 From: Anthony Burchell Date: Tue, 11 Feb 2020 04:38:55 +0000 Subject: [PATCH] Media: Reset aspect ratio constraints when width and height fields fail numeric validation. Props TBschen, valentinbora. Fixes #49073. git-svn-id: https://develop.svn.wordpress.org/trunk@47262 602fd350-edb4-49c9-b593-d223f7449a82 --- src/js/_enqueues/lib/image-edit.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/js/_enqueues/lib/image-edit.js b/src/js/_enqueues/lib/image-edit.js index fc84e777dd..f36f8c8808 100644 --- a/src/js/_enqueues/lib/image-edit.js +++ b/src/js/_enqueues/lib/image-edit.js @@ -1113,6 +1113,10 @@ h = $('#image-preview-' + postid).height(); if ( false === this.validateNumeric( el ) ) { + this.iasapi.setOptions({ + aspectRatio: null + }); + return; }