Skip to content

Commit

Permalink
Merge pull request #1375 from wordpress-mobile/issue/1373_tap_links_o…
Browse files Browse the repository at this point in the history
…pens_safari

Don't allow interactions with URL in Aztec text blocks.
  • Loading branch information
SergioEstevao authored Oct 1, 2019
2 parents 1ddbc6f + 44544a9 commit 638c72e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
5 changes: 5 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.14.0
------
* Fix a bug on iOS 13.0 were tapping on a link opens Safari
* Fix a link editing issue, where trying to add a empty link at the start of another link would remove the existing link.

1.12.0
------
* Add rich text styling to video captions
Expand Down
2 changes: 1 addition & 1 deletion gutenberg
Submodule gutenberg updated 66 files
+1 −0 .travis.yml
+4 −0 assets/stylesheets/_mixins.scss
+1 −1 gutenberg.php
+1 −1 package-lock.json
+1 −1 package.json
+2 −2 packages/block-editor/src/components/block-settings-menu/index.js
+8 −4 packages/block-editor/src/components/block-styles/index.js
+5 −2 packages/block-editor/src/components/block-switcher/index.js
+6 −5 packages/block-editor/src/components/inserter/menu.js
+4 −0 packages/block-editor/src/components/media-placeholder/styles.native.scss
+7 −0 packages/block-library/src/button/index.js
+1 −0 packages/block-library/src/calendar/index.js
+9 −0 packages/block-library/src/code/index.js
+44 −1 packages/block-library/src/columns/index.js
+17 −0 packages/block-library/src/cover/index.js
+9 −0 packages/block-library/src/gallery/index.js
+55 −1 packages/block-library/src/group/index.js
+6 −0 packages/block-library/src/heading/index.js
+5 −0 packages/block-library/src/html/index.js
+7 −0 packages/block-library/src/image/index.js
+5 −0 packages/block-library/src/list/index.js
+20 −0 packages/block-library/src/media-text/index.js
+1 −0 packages/block-library/src/more/index.js
+15 −5 packages/block-library/src/navigation-menu-item/edit.js
+2 −4 packages/block-library/src/navigation-menu-item/editor.scss
+0 −1 packages/block-library/src/navigation-menu/edit.js
+8 −3 packages/block-library/src/navigation-menu/editor.scss
+1 −0 packages/block-library/src/nextpage/index.js
+3 −1 packages/block-library/src/paragraph/index.js
+7 −0 packages/block-library/src/preformatted/index.js
+6 −0 packages/block-library/src/pullquote/index.js
+8 −1 packages/block-library/src/quote/index.js
+5 −0 packages/block-library/src/rss/index.js
+1 −0 packages/block-library/src/search/index.js
+7 −0 packages/block-library/src/separator/index.js
+7 −0 packages/block-library/src/social-links/index.js
+70 −0 packages/block-library/src/table/index.js
+10 −0 packages/block-library/src/verse/index.js
+13 −0 packages/blocks/README.md
+15 −0 packages/blocks/src/api/factory.js
+1 −0 packages/blocks/src/api/index.js
+1 −0 packages/components/src/button/style.scss
+1 −1 packages/core-data/src/entities.js
+8 −0 packages/e2e-test-utils/README.md
+1 −0 packages/e2e-test-utils/src/index.js
+10 −0 packages/e2e-test-utils/src/offline-mode.js
+7 −0 packages/e2e-tests/config/setup-test-framework.js
+66 −2 packages/e2e-tests/specs/autosave.test.js
+40 −8 packages/edit-widgets/src/components/customizer-edit-widgets-initializer/sync-customizer.js
+2 −19 packages/edit-widgets/src/components/edit-widgets-initializer/index.js
+37 −9 packages/edit-widgets/src/components/save-button/index.js
+50 −36 packages/edit-widgets/src/components/widget-area/index.js
+4 −2 packages/edit-widgets/src/components/widget-areas/index.js
+0 −1 packages/edit-widgets/src/index.js
+0 −89 packages/edit-widgets/src/store/actions.js
+0 −7 packages/edit-widgets/src/store/constants.js
+0 −23 packages/edit-widgets/src/store/index.js
+0 −69 packages/edit-widgets/src/store/reducer.js
+0 −38 packages/edit-widgets/src/store/selectors.js
+0 −207 packages/edit-widgets/src/store/test/actions.js
+0 −123 packages/edit-widgets/src/store/test/reducer.js
+0 −91 packages/edit-widgets/src/store/test/selectors.js
+54 −66 packages/editor/src/components/local-autosave-monitor/index.js
+14 −0 packages/editor/src/store/actions.js
+35 −0 packages/editor/src/store/controls.js
+8 −1 packages/format-library/src/link/index.native.js
19 changes: 13 additions & 6 deletions react-native-aztec/ios/RNTAztecView/RCTAztecView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -610,12 +610,19 @@ extension RCTAztecView: UITextViewDelegate {
onBlur?([:])
}

func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
// Sergio Estevao: This shouldn't happen in an editable textView, but it looks we have a system bug in iOS13 so we need this workaround
let position = characterRange.location
textView.selectedRange = NSRange(location: position, length: 0)
textView.typingAttributes = textView.attributedText.attributes(at: position, effectiveRange: nil)
textView.delegate?.textViewDidChangeSelection?(textView)
func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
if #available(iOS 13.1, *) {
return false
} else if #available(iOS 13.0.0, *) {
// Sergio Estevao: This shouldn't happen in an editable textView, but it looks we have a system bug in iOS13 so we need this workaround
let position = characterRange.location
textView.selectedRange = NSRange(location: position, length: 0)
textView.typingAttributes = textView.attributedText.attributes(at: position, effectiveRange: nil)
textView.delegate?.textViewDidChangeSelection?(textView)
} else {
return false
}

return false
}
}

0 comments on commit 638c72e

Please sign in to comment.