Skip to content

Commit

Permalink
revert - add selectionStart and selectionEnd to transientEdits (#22933)
Browse files Browse the repository at this point in the history
  • Loading branch information
dratwas committed Jun 5, 2020
1 parent 1f790bc commit 68f62ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
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

0 comments on commit 68f62ad

Please sign in to comment.