Skip to content

Commit

Permalink
🐛 fix RCI.Input types (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardodino committed Mar 25, 2023
1 parent 7d86284 commit 981fc39
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
13 changes: 4 additions & 9 deletions packages/rci/src/components/CodeInput.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import React from 'react'
import { useCodeInput } from 'use-code-input'
import { RenderSegmentFn } from '../types/RenderSegmentFn'
import type { RenderSegmentFn } from '../types/RenderSegmentFn'

import * as RCI from './RCI'

type InputProps = Omit<
React.ComponentPropsWithRef<'input'>,
'maxLength' | 'children'
>

export type CodeInputProps = InputProps & {
export type CodeInputProps = RCI.InputProps & {
inputRef: React.RefObject<HTMLInputElement>
renderSegment: RenderSegmentFn

Expand All @@ -32,8 +27,8 @@ export type CodeInputProps = InputProps & {
/** advanced: can be used if input needs to be larger (example: auto-fill buttons are overlapping input) */
inputWidth?: string

inputClassName?: InputProps['className']
inputStyle?: InputProps['style']
inputClassName?: RCI.InputProps['className']
inputStyle?: RCI.InputProps['style']
}

export const CodeInput = ({
Expand Down
5 changes: 3 additions & 2 deletions packages/rci/src/components/RCI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ export const InputScrollWrapper = (props: CodeInputInputScrollWrapperProps) => {
)
}

type InputProps = Omit<
export type InputProps = Omit<
React.ComponentPropsWithRef<'input'>,
'maxLength' | 'children'
'maxLength' | 'children' | 'value'
>

export const Input = React.forwardRef<HTMLInputElement, InputProps>(
(props, ref) => {
const length = useLengthContext()
Expand Down

0 comments on commit 981fc39

Please sign in to comment.