Skip to content

Commit 2399159

Browse files
author
cnilton
committed
fixed blur animation bug
1 parent ec9e997 commit 2399159

File tree

3 files changed

+6
-23
lines changed

3 files changed

+6
-23
lines changed

README.md

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ yarn add react-native-floating-label-input
2424

2525
## ⚠ Important
2626

27-
- If you are using version 1.3.5 see the instructions below.
27+
- If you are using version 1.3.5 or higher, follow instructions below.
2828
- If not, just install:
2929
```bash
3030
@@ -36,7 +36,7 @@ or
3636
3737
```
3838

39-
# Version 1.3.5 **react-native-reanimated v2**
39+
# Version 1.3.5 or higher **react-native-reanimated v2**
4040

4141
- All animations now are using react-native-reanimated v2, as it was officially released recently. Please follow the Software Mansion guide installation for the react-native-reanimated v2: https://docs.swmansion.com/react-native-reanimated/docs/installation
4242

@@ -145,17 +145,6 @@ const app: React.FC = () => {
145145
export default app;
146146
```
147147

148-
# Version 1.3.0 🎉🎉
149-
150-
- Animation added to font size on focus and on blur;
151-
- **new** animationDuration prop added;
152-
- staticLabel bug fixed when in multiline;
153-
- Smoother animations;
154-
155-
## New Features
156-
157-
Mask has been updated, and some bugs should have been fixed. Features as **leftComponent**, **onTogglePassword**, **customShowPasswordComponent**, **customHidePasswordComponent**, **staticLabel**, **hint** and **hintTextColor** have been added! Checkout the usage:
158-
159148
### leftComponent : JSX.Element
160149

161150
- Add left component to your input. Usually used for displaying icon
@@ -197,10 +186,6 @@ const app: React.FC = () => {
197186
export default app;
198187
```
199188

200-
### onTogglePassword : (boolean) => void
201-
202-
- Callback for show/hide password
203-
204189
### customShowPasswordComponent and customHidePasswordComponent : JSX.Element
205190

206191
- Set your own show/hide password component
@@ -248,7 +233,7 @@ export default app;
248233

249234
- Set the color to the hint
250235

251-
#### New props usage example
236+
#### Example
252237

253238
<img src ="https://i.imgur.com/cgQsY20.gif" width="40%"/>
254239

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-native-floating-label-input",
33
"description": "A simple and customizable React Native TextInput with it's placeholder always shown.",
4-
"version": "1.3.5",
4+
"version": "1.3.6",
55
"main": "index.tsx",
66
"private": false,
77
"repository": {
@@ -36,9 +36,7 @@
3636
},
3737
"peerDependencies": {
3838
"react": "*",
39-
"react-native": "*"
40-
},
41-
"dependencies": {
39+
"react-native": "*",
4240
"react-native-reanimated": "^2.0.0"
4341
},
4442
"devDependencies": {

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ const FloatingLabelInput: React.ForwardRefRenderFunction<InputRef, Props> = (
283283
}, [togglePassword]);
284284

285285
useEffect(() => {
286-
if (isFocusedState) {
286+
if (isFocusedState || value !== '') {
287287
if (halfTop !== 0) {
288288
animateFocus();
289289
}

0 commit comments

Comments
 (0)