Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert - add selectionStart and selectionEnd to transientEdits #22933

Merged
merged 1 commit into from
Jun 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/editor/src/components/provider/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ const postTypeEntities = [
...postTypeEntity,
transientEdits: {
blocks: true,
selectionStart: true,
selectionEnd: true,
},
mergedEdits: {
meta: true,
Expand Down
6 changes: 3 additions & 3 deletions packages/rich-text/src/component/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import RCTAztecView from 'react-native-aztec';
import { View, Platform } from 'react-native';
import { addMention } from 'react-native-gutenberg-bridge';
import { get, pickBy, debounce } from 'lodash';
import { get, pickBy } from 'lodash';
import memize from 'memize';

/**
Expand Down Expand Up @@ -88,7 +88,7 @@ export class RichText extends Component {
this.formatToValue = memize( this.formatToValue.bind( this ), {
maxSize: 1,
} );
this.debounceCreateUndoLevel = debounce( this.onCreateUndoLevel, 1000 );

// This prevents a bug in Aztec which triggers onSelectionChange twice on format change
this.onSelectionChange = this.onSelectionChange.bind( this );
this.onSelectionChangeFromAztec = this.onSelectionChangeFromAztec.bind(
Expand Down Expand Up @@ -276,7 +276,7 @@ export class RichText extends Component {
const contentWithoutRootTag = this.removeRootTagsProduceByAztec(
unescapeSpaces( event.nativeEvent.text )
);
this.debounceCreateUndoLevel();

const refresh = this.value !== contentWithoutRootTag;
this.value = contentWithoutRootTag;

Expand Down