[Image Block] Set default values of the width and height input fields according to the actual image dimensions#7687
Merged
gziolo merged 1 commit intoWordPress:masterfrom Feb 4, 2019
nfmohit:update/image-block/7638
Merged
[Image Block] Set default values of the width and height input fields according to the actual image dimensions#7687gziolo merged 1 commit intoWordPress:masterfrom nfmohit:update/image-block/7638
gziolo merged 1 commit intoWordPress:masterfrom
nfmohit:update/image-block/7638
Conversation
Contributor
|
The changes look good to me but tests are failing. Seems unrelated to the changes? |
Member
|
It looks like this PR needs to be updated to align with the latest changes from master branch. |
…the actual image dimensions
Member
Author
|
PR is refreshed, thank you for the review @gziolo ❤️ |
gziolo
approved these changes
Feb 4, 2019
Member
gziolo
left a comment
There was a problem hiding this comment.
This is a really nice improvement 👍
Nice work, thanks for being so patient to wait until this PR gets reviewed and refreshing it so quickly. Thank you for your contribution 💯
Member
Author
|
Thank you for the merge and for your kind words @gziolo ❤️ |
daniloercoli
added a commit
that referenced
this pull request
Feb 5, 2019
…rnmobile/372-use-RichText-on-Title-block * 'master' of https://github.com/WordPress/gutenberg: (22 commits) Make the modal title styling consistent (#13669) Disable navigation block for text mode. (#12185) Fix: Linting problem in modal example code (#13671) Add myself as a code owner to the annotations (#13672) Add more reviewers to CODEOWNERS.md file (#13667) Plugin: Remove jQuery heartbeat-to-hooks proxying (#13576) Workflow: Add repository CODEOWNERS file (#13604) Add a mobile minimum size for form fields (#13639) Update edit-save documentation (#13578) Alt image setting (#13631) Fix: Allow years lower than 1970 in DateTime component. (#13602) Using addQueryArgs to generate Manage All Reusable Blocks link (#13653) Bump plugin version to 5.0.0-rc.1 (#13652) Update lodash to 4.17.10 (#13651) Refreshed PR (#9469) Set default values of the width and height input fields according to the actual image dimensions (#7687) 12647 fix css color picker (#12747) Remove "we" from messages (#13644) Fix: Font size picker max width on mobile (#13264) Fix/issue 12501 menu item aria label ...
This was referenced Feb 18, 2019
youknowriad
pushed a commit
that referenced
this pull request
Mar 6, 2019
…the actual image dimensions (#7687)
youknowriad
pushed a commit
that referenced
this pull request
Mar 6, 2019
…the actual image dimensions (#7687)
This was referenced Apr 30, 2020
This was referenced May 1, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #7638.
This PR addresses #7638 which reports the unexpected behavior of changing the input values, as the placeholder shows the actual image dimensions but pressing the up/down arrows of the number input fields start their values from
0.This PR strips out the placeholder from the mentioned fields and sets the actual dimensions as the default field values. The default values don't take effect until they are changed and when they are changed, values start changing from the displayed width or height values, which is described as the expected behavior in #7638.
How has this been tested?
This has been tested by going through the following steps:
The values should start changing from the actual image dimensions, as opposed to the previous behavior which started the change from
0. It has also been made sure that the default values do not take effect on the image until the field values are actually changed.This was tested in WP 4.9.6, Gutenberg 3.1.1, Apache server with PHP 7.2.0 and MySQL 5.6.34. According to initial tests, the code doesn’t seem to affect any other areas.
Types of changes
This PR removes the
placeholderattribute from the width and height numberinputfields. Then it sets theimageWidthandimageHeightvariables in place of the blankvalueattribute when the dimensions areundefined.Checklist: