From 87e1f0e11cafbe2fdb99a24307164a1ed5569832 Mon Sep 17 00:00:00 2001 From: hyochan Date: Fri, 5 Feb 2021 13:51:54 +0900 Subject: [PATCH] Release 0.0.43 Restructured [EditText] and error fixes --- CHANGELOGS.md | 6 ++++++ lib/package.json | 2 +- main/EditText.tsx | 11 ++++------- main/__tests__/EditText.test.tsx | 13 ++++++++----- main/__tests__/__snapshots__/EditText.test.tsx.snap | 8 ++++---- stories/dooboo-ui/EditText.stories.tsx | 2 ++ 6 files changed, 25 insertions(+), 17 deletions(-) diff --git a/CHANGELOGS.md b/CHANGELOGS.md index c97cf434..faf4896d 100644 --- a/CHANGELOGS.md +++ b/CHANGELOGS.md @@ -1,5 +1,11 @@ ## Changelogs +## 0.0.43 + +[EditText] + +- Fixed hovering issue in `0.0.42` in `column` type. Also fixed where `hover` style should be applied. Previously it was a `container` but it should be applied to the first child `View`. + ## 0.0.42 [EditText] diff --git a/lib/package.json b/lib/package.json index a7326d91..194fefeb 100644 --- a/lib/package.json +++ b/lib/package.json @@ -1,6 +1,6 @@ { "name": "dooboo-ui", - "version": "0.0.42", + "version": "0.0.43", "main": "index.js", "types": "index.d.ts", "author": "dooboolab", diff --git a/main/EditText.tsx b/main/EditText.tsx index d2d82d13..6c9d1188 100644 --- a/main/EditText.tsx +++ b/main/EditText.tsx @@ -72,6 +72,7 @@ const Component: FC = ({ }) => { const [focused, setFocused] = useState(false); const ref = useRef(null); + const hovered = useHover(ref); const borderColor = disableColor; const labelColor = disableColor; @@ -95,6 +96,7 @@ const Component: FC = ({ hovered: [ { borderBottomColor: hoveredColor, + borderBottomWidth: 1, }, styles?.hovered, ], @@ -183,8 +185,6 @@ const Component: FC = ({ ], }; - const hovered = useHover(ref); - return ( = ({ web: ref, default: undefined, })} - style={[ - editable && hovered && [compositeStyles.hovered, styles?.hovered], - {alignSelf: 'stretch', flexDirection: 'column'}, - style, - ]}> + style={[{alignSelf: 'stretch', flexDirection: 'column'}, style]}> ({ useHover: () => false, @@ -53,9 +53,12 @@ describe('[EditText]', () => { container = await waitFor(() => testingLib.getByTestId('container-id')); - const containerCustomStyle = container.props.style[0][1]; + const containerChildViewCustomStyle = container.findByType(View) + .instance.props.style[1][1]; - expect(containerCustomStyle).toEqual({backgroundColor: 'green'}); + expect(containerChildViewCustomStyle).toEqual({ + backgroundColor: 'green', + }); }); describe('labeText', () => { @@ -293,7 +296,7 @@ describe('[EditText]', () => { }); }); - // // Below tests is emitting console error but this is expeted + //? Below tests is emitting console error but this is expeted describe('web', () => { beforeAll(() => { jest.mock('react-native/Libraries/Utilities/Platform', () => ({ diff --git a/main/__tests__/__snapshots__/EditText.test.tsx.snap b/main/__tests__/__snapshots__/EditText.test.tsx.snap index 22332b32..7e494651 100644 --- a/main/__tests__/__snapshots__/EditText.test.tsx.snap +++ b/main/__tests__/__snapshots__/EditText.test.tsx.snap @@ -4,7 +4,6 @@ exports[`[EditText] interactions Type: [column] renders custom styles without cr { Sign in with Email { onSubmitEditing={onSignIn} />