Skip to content

Is there a way to create textinput-like component? #1289

Discussion options

You must be logged in to vote

Hey @damsonFilipson,

That a lot work to do, but If you want to implement this in my opinion, you want to focus on the element/input behaviour, however to draw the actually result you just use Skia components, e.g. <Text /> and <RoundedRect />, let improvise an idea here of behaviour:

import React, { useState } from 'react';
import { Canvas, Text, RoundedRect, useFont } from '@shopify/react-native-skia';
import { GestureResponderEvent } from 'react-native';

enum EInputState {
  NONE = 0,
  FOCUS = 1,
  ACTIVE = 2,
  BLUR = 3
};

export type Props = {
  defaultValue?: number;
}
export default function FloatInput({ defaultValue = 0.0 }: Props) {
  const [state, setState] = useState(EInputState

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@damsonFilipson
Comment options

Answer selected by damsonFilipson
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants