Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

[MV-336] Add custom text input #52

Merged
merged 4 commits into from
Mar 15, 2023
Merged

Conversation

skyman503
Copy link
Contributor

This change introduces new component that should be used, when asking user for text input.

};

return (
<TextInput
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On my Android device the cursor and the selection is dark green and that doesn't look nice. Use selectionColor and cursorColor props to set it to the correct color (dark blue?)

We may need to upgrade RN version for it to look good though

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The handles color is broken even on the newest RN version 😅 Apparently this didn't fix it.
Maybe try adding it on the native side like here (in styles.xml): https://stackoverflow.com/questions/29795197/how-to-change-color-of-edittext-handles
If you've never done anything like this you can always ask me for help

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should work okey now.

import React, { useState } from 'react';
import { StyleSheet, TextInput } from 'react-native';

const StandardTextInputStyles = StyleSheet.create({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we just name it TextInput? Adding nothing makes it standard :p

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed styles and props.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skyman503 What about a component?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I though it's better not to override default names to avoid confusion later on. However, I tried doing that but it makes es-lint angry because of: 'TextInput' is already defined. eslint[@typescript-eslint/no-redeclare] in the StandardTextInput.tsx. Idk whether ignoring that is a good idea. WDYT @graszka22 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FIxed.

example/src/components/StandardTextInput.tsx Outdated Show resolved Hide resolved
@skyman503 skyman503 merged commit d8f5bf4 into master Mar 15, 2023
@skyman503 skyman503 deleted the @skyman503/MV-336-text-input branch March 15, 2023 12:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants