Skip to content
This repository was archived by the owner on Jul 9, 2026. It is now read-only.

Add Array.prototype.flatMap polyfill - #3035

Merged
fluiddot merged 1 commit into
developfrom
fix/flatmap-polyfill
Jan 22, 2021
Merged

fluiddot merged 1 commit into
developfrom
fix/flatmap-polyfill

Conversation

@fluiddot

@fluiddot fluiddot commented Jan 21, 2021 •

Copy link
Copy Markdown
Contributor

Fixes #3034

gutenberg PR: WordPress/gutenberg#28400

Description

Adds a polyfill for Array.prototype.flatMap function (built-in flatMap) because it's not fully supported on Android.

So far this wasn't needed because there were no references to that function but in a recent PR in gutenberg it was introduced. It was added in the logic related to converting HTML to blocks, this functionality is used among other places in the Paste handler logic that is also used in the RichText component.

To test

  1. Add a paragraph block
  2. Write some words and set some of them as bold or italic
  3. Select all the text and copy it
  4. Paste it in the same paragraph or another one
  5. Check that no error is shown

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered if this change warrants user-facing release notes more info and have added them to RELEASE-NOTES.txt if necessary.

@fluiddot fluiddot added [Type] Bug Something isn't working Web breakage Caused by incompatible changes on Gutenberg web labels Jan 21, 2021
@fluiddot fluiddot added this to the 1.46 (16.7) milestone Jan 21, 2021
@fluiddot fluiddot self-assigned this Jan 21, 2021

@mchowning mchowning left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested and approved the gutenberg PR: WordPress/gutenberg#28400 (review)

@fluiddot
fluiddot marked this pull request as ready for review January 22, 2021 08:27
@peril-wordpress-mobile

peril-wordpress-mobile Bot commented Jan 22, 2021 •

Copy link
Copy Markdown

Wanna run full suite of Android and iOS UI tests? Click here and 'Approve' CI job!

@fluiddot
fluiddot force-pushed the fix/flatmap-polyfill branch from dd7e08a to 04199fe Compare January 22, 2021 09:34
@fluiddot

Copy link
Copy Markdown
Contributor Author

I've run the full suite of Android and iOS UI tests to verify that the original test that was failing now passes 🎊 .

@fluiddot
fluiddot merged commit 776e5e8 into develop Jan 22, 2021
@fluiddot
fluiddot deleted the fix/flatmap-polyfill branch January 22, 2021 10:23
@fluiddot fluiddot mentioned this pull request Feb 1, 2021
3 tasks done
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

[Type] Bug Something isn't working Web breakage Caused by incompatible changes on Gutenberg web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pasting a text with text styles applied generates a exception

2 participants