Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
dom.isHorizontalEdge(element, true);
// $ExpectType boolean
dom.isTextField(element);
// $ExpectType boolean
dom.isVerticalEdge(element, false);
// $ExpectType void
dom.placeCaretAtHorizontalEdge(element, true);
// $ExpectType void
dom.placeCaretAtHorizontalEdge(undefined, false);
// $ExpectType void
dom.placeCaretAtVerticalEdge(element, true);
// $ExpectType void
dom.placeCaretAtVerticalEdge(undefined, false);
// $ExpectType void
dom.remove(node);
// $ExpectType void
dom.replace(node, node);
// $ExpectType HTMLParagraphElement
dom.replaceTag(node, 'p');
// $ExpectType HTMLSpanElement
dom.replaceTag(node, 'span');
dom.isTextField(element);
// $ExpectType boolean
dom.isVerticalEdge(element, false);
// $ExpectType void
dom.placeCaretAtHorizontalEdge(element, true);
// $ExpectType void
dom.placeCaretAtHorizontalEdge(undefined, false);
// $ExpectType void
dom.placeCaretAtVerticalEdge(element, true);
// $ExpectType void
dom.placeCaretAtVerticalEdge(undefined, false);
// $ExpectType void
dom.remove(node);
// $ExpectType void
dom.replace(node, node);
// $ExpectType HTMLParagraphElement
dom.replaceTag(node, 'p');
// $ExpectType HTMLSpanElement
dom.replaceTag(node, 'span');
// $ExpectType void
dom.unwrap(node);
)
) {
// Shift key is down, and there is multi selection or we're at
// the end of the current block.
this.expandSelection( isReverse );
event.preventDefault();
}
} else if ( hasMultiSelection ) {
// Moving from block multi-selection to single block selection
this.moveSelection( isReverse );
event.preventDefault();
} else if ( isVertical && isVerticalEdge( target, isReverse ) ) {
const closestTabbable = this.getClosestTabbable( target, isReverse );
if ( closestTabbable ) {
placeCaretAtVerticalEdge( closestTabbable, isReverse, this.verticalRect );
event.preventDefault();
}
} else if ( isHorizontal && getSelection().isCollapsed && isHorizontalEdge( target, isReverseDir ) ) {
const closestTabbable = this.getClosestTabbable( target, isReverseDir );
placeCaretAtHorizontalEdge( closestTabbable, isReverseDir );
event.preventDefault();
}
}
// If reversed (e.g. merge via backspace), use the last in the set of
// tabbables.
const isReverse = -1 === initialPosition;
const target = (isReverse ? last : first)(textInputs);
if (! target) {
this.wrapperNode.focus();
return;
}
target.focus();
// In reverse case, need to explicitly place caret position.
if (isReverse) {
placeCaretAtHorizontalEdge(target, true);
placeCaretAtVerticalEdge(target, true);
}
}