fixed counter & keyboard

This commit is contained in:
ue 2018-10-20 16:05:46 +03:00
parent 3ee5828b18
commit 2604c20a17
3 changed files with 3 additions and 3 deletions

View File

@ -81,7 +81,7 @@ export default class MarkdownEditorView extends Component {
<View style={styles.leftButtonsWrapper}>
<FlatList
data={Formats}
// keyboardShouldPersistTaps="always"
keyboardShouldPersistTaps="always"
renderItem={({ item }) => this._renderMarkupButton({ item, getState, setState })}
horizontal
/>

View File

@ -51,7 +51,7 @@ export class EditorScreen extends Component {
<View style={globalStyles.defaultContainer}>
<EditorHeader
isPreviewActive={isPreviewActive}
quickTitle={wordsCount && `${wordsCount} words`}
quickTitle={wordsCount > 0 && `${wordsCount} words`}
handleOnPressPreviewButton={this._handleOnPressPreviewButton}
/>
<View style={globalStyles.containerHorizontal16}>

View File

@ -1 +1 @@
export const getWordsCount = text => text.replace(/^\s+|\s+$/g, '').split(/\s+/).length;
export const getWordsCount = text => (text ? text.replace(/^\s+|\s+$/g, '').split(/\s+/).length : 0);