react-native-controlled-mentions
Advanced tools
Comparing version
# Changelog | ||
## [Unreleased](https://github.com/dabakovich/react-native-controlled-mentions/tree/HEAD) | ||
## [v1.0.0](https://github.com/dabakovich/react-native-controlled-mentions/tree/v1.0.0) (2020-12-29) | ||
[Full Changelog](https://github.com/dabakovich/react-native-controlled-mentions/compare/v1.0.0-0...HEAD) | ||
[Full Changelog](https://github.com/dabakovich/react-native-controlled-mentions/compare/v1.0.0-0...v1.0.0) | ||
@@ -7,0 +7,0 @@ **Implemented enhancements:** |
@@ -20,5 +20,6 @@ "use strict"; | ||
* The method for getting parts between two cursor positions. | ||
* | ||
* ``` | ||
* | part1 | part2 | part3 | | ||
* a b c|d e f g h i j h k|l m n o | ||
* ``` | ||
* We will get 3 parts here: | ||
@@ -41,2 +42,5 @@ * 1. Part included 'd' | ||
let partsInterval = []; | ||
if (!currentPart || !newPart) { | ||
return partsInterval; | ||
} | ||
// Push whole first affected part or sub-part of the first affected part | ||
@@ -97,4 +101,6 @@ if (currentPart.position.start === cursor && currentPart.position.end <= newCursor) { | ||
default: { | ||
newParts = newParts.concat(getPartsInterval(parts, cursor, change.count)); | ||
cursor += change.count; | ||
if (change.count !== 0) { | ||
newParts = newParts.concat(getPartsInterval(parts, cursor, change.count)); | ||
cursor += change.count; | ||
} | ||
break; | ||
@@ -101,0 +107,0 @@ } |
{ | ||
"name": "react-native-controlled-mentions", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Fully controlled React Native mentions component", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -6,3 +6,3 @@ react-native-controlled-mentions [![npm version][npm-image]][npm-url] | ||
* Gracefully render formatted mentions directly in RN `TextInput` component | ||
* Support for different mention types (user [@mentions](), **#hashtags**, etc) | ||
* Support for different mention types (**[@user mentions](#demo)**, **#hashtags**, etc) | ||
* Use `value`/`onChange` as in usual `TextInput` props | ||
@@ -9,0 +9,0 @@ * Completely typed (written on TypeScript) |
Sorry, the diff of this file is not supported yet
67332
0.43%786
0.77%