Skip to content

Conversation

@joshuatf
Copy link
Contributor

All Submissions:

Changes proposed in this Pull Request:

This PR is a workaround to prevent Gutenberg's focus of initially selected elements. Note that we need to select an element initially in order to get the toolbar to show, but we don't the focus to immediately go to these editors.

Closes #35697 .

  • This PR is a very minor change/addition and does not require testing instructions (if checked you can ignore/remove the next section).

How to test the changes in this Pull Request:

  1. Load the new product management experience ("Products -> Add new (MVP)")
  2. On page load, make sure that the rich text editor toolbars are shown
  3. Make sure that neither of the editors are focused
  4. Make some changes inside an editor and make sure things continue to work as expected

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you created a changelog file for each project being changed, ie pnpm --filter=<project> changelog add?

FOR PR REVIEWER ONLY:

  • I have reviewed that everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities. I made sure Linting is not ignored or disabled.

@joshuatf joshuatf requested a review from a team November 23, 2022 21:38
@joshuatf joshuatf self-assigned this Nov 23, 2022
@github-actions github-actions bot added the package: @woocommerce/components issues related to @woocommerce/components label Nov 23, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Nov 23, 2022

Test Results Summary

Commit SHA: 78615f8

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 50s
E2E Tests186006019213m 6s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

Copy link
Contributor

@mdperez86 mdperez86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some linter problems

@joshuatf
Copy link
Contributor Author

Thanks for noting that, @mdperez86!

Updated in b186c77 to check for this method since the unit tests don't have access to the same block editor store.

return;
}

__unstableSetEditorMode( val ? 'initialized' : 'edit' );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that TypeScript says explicitly it's a boolean, but reading this part with val made me confused for a little bit. What do you think about renaming to isInitializing?

@mdperez86 mdperez86 self-requested a review November 30, 2022 17:56
mdperez86
mdperez86 previously approved these changes Nov 30, 2022
Copy link
Contributor

@mdperez86 mdperez86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@joshuatf joshuatf merged commit a6970f3 into trunk Nov 30, 2022
@joshuatf joshuatf deleted the fix/35697 branch November 30, 2022 20:28
@github-actions github-actions bot added this to the 7.3.0 milestone Nov 30, 2022
psealock added a commit to psealock/woocommerce that referenced this pull request Dec 1, 2022
* Use workflow dispatch that now works with GITHUB_TOKEN

* check if post_type exists (woocommerce#34501)

* check if post_type exists

* Changelog.

Co-authored-by: barryhughes <[email protected]>

* Fix Protected Directory Detection and Admin Notice (woocommerce#33544)

* Fix Protected Directory Admin Notice

- make notice actually close when clicking "Dismiss"
- make unprotected directory detection smarter: not every /woocommerce_uploads/ page with content is a directory listing

* Unwind the change made to method `is_uploads_directory_protected()`.

Discussion here https://github.com/woocommerce/woocommerce/pull/33544/files#r910253861 relates. In essence, we felt it better to have more warnings prompting the user to evaluate if the directory is protected, than fewer warnings with an increased change of not flagging actual problems.

* Add changelog.

Co-authored-by: barryhughes <[email protected]>

* Update wc-account-functions.php (woocommerce#32026)

* Update wc-account-functions.php

Correct order of single/plural translation strings to prevent confusion with translations and translators.

* Changelog.

Co-authored-by: barryhughes <[email protected]>

* Set editor mode on initialization to prevent initial text editor focus (woocommerce#35701)

* Set editor mode on initialization to prevent initial text editor focus

* Add changelog entry

* Check for editor set method to prevent breaks in tests with older versions of block store

* Update argument name for initialization

* Use workflow dispatch that now works with GITHUB_TOKEN (#6)

* Fix indentation of code freeze yml file

* Dev/use workflow dispatch (#8)

* Fix indentation of code freeze yml file

* Use context to get repo and owner.

* Send the required inputs to dispatched workflow.

Co-authored-by: Sam Seay <[email protected]>
Co-authored-by: justasdobrovolskis <[email protected]>
Co-authored-by: barryhughes <[email protected]>
Co-authored-by: Andrew <[email protected]>
Co-authored-by: Philip <[email protected]>
Co-authored-by: Joshua T Flowers <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: @woocommerce/components issues related to @woocommerce/components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Components] Rich text editor receives focus on page load

4 participants