mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-11-28 10:22:38 +03:00
revert
This commit is contained in:
parent
4b9066632e
commit
2efa82169e
@ -38,14 +38,12 @@ export default class TagAreaView extends Component {
|
||||
|
||||
// Component Functions
|
||||
_handleOnChange = (text, i) => {
|
||||
const { chips } = this.state;
|
||||
|
||||
this.setState({
|
||||
currentText: text.replace(/\s/g, ''),
|
||||
});
|
||||
|
||||
if (text.indexOf(' ') > 0 && text) {
|
||||
this._handleTagAdded(chips[i] ? i : null);
|
||||
this._handleTagAdded();
|
||||
}
|
||||
if (!text && i !== 0) {
|
||||
this._handleTagRemove(i);
|
||||
@ -54,7 +52,6 @@ export default class TagAreaView extends Component {
|
||||
|
||||
_handleOnBlur = (i) => {
|
||||
this._handleTagAdded(i);
|
||||
this.setState({ activeChip: null });
|
||||
};
|
||||
|
||||
_handleTagAdded = (i = null, text = null) => {
|
||||
@ -67,8 +64,8 @@ export default class TagAreaView extends Component {
|
||||
currentText: '',
|
||||
});
|
||||
} else if (_currentText && chips && chips.length === chipsCount) {
|
||||
const _chips = chips;
|
||||
_chips[chipsCount - 1] = currentText;
|
||||
let _chips = chips;
|
||||
_chips[chipsCount -1] = currentText;
|
||||
this.setState({
|
||||
chips: _chips,
|
||||
currentText: null,
|
||||
@ -118,9 +115,7 @@ export default class TagAreaView extends Component {
|
||||
handleOnChange={text => this._handleOnChange(text, i)}
|
||||
handleOnBlur={() => this._handleOnBlur(i)}
|
||||
blurOnSubmit
|
||||
value={
|
||||
activeChip === i ? currentText || chip.replace(/\s/g, '') : chip.replace(/\s/g, '')
|
||||
}
|
||||
value={activeChip === i ? currentText : chip}
|
||||
autoCapitalize="none"
|
||||
onFocus={() => this.setState({ activeChip: i })}
|
||||
{...this.props}
|
||||
|
Loading…
Reference in New Issue
Block a user