From ef64c003ebab02879a10f85f8502366dc0333b52 Mon Sep 17 00:00:00 2001 From: shubham-eaton Date: Mon, 11 Nov 2024 10:37:49 +0530 Subject: [PATCH 1/3] Fixed login keyboard dismiss error on login click --- login-workflow/CHANGELOG.md | 6 ++++++ login-workflow/package.json | 2 +- login-workflow/src/screens/LoginScreen/LoginScreen.tsx | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/login-workflow/CHANGELOG.md b/login-workflow/CHANGELOG.md index 2da19a76..80569c92 100644 --- a/login-workflow/CHANGELOG.md +++ b/login-workflow/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## v7.0.1 (November 11, 2024) + +### Fixed + +- Pressing login does not dismiss keyboard and can obscure error modal [514](https://github.com/etn-ccis/blui-react-native-workflows/issues/514) + ## v7.0.0 (September 20, 2024) ### Fixed diff --git a/login-workflow/package.json b/login-workflow/package.json index e409bc80..85e37dce 100644 --- a/login-workflow/package.json +++ b/login-workflow/package.json @@ -1,7 +1,7 @@ { "name": "@brightlayer-ui/react-native-auth-workflow", "description": "Re-usable workflow components for Authentication and Registration within Eaton applications.", - "version": "7.0.0", + "version": "7.0.1", "license": "BSD-3-Clause", "author": { "name": "Brightlayer UI", diff --git a/login-workflow/src/screens/LoginScreen/LoginScreen.tsx b/login-workflow/src/screens/LoginScreen/LoginScreen.tsx index 4a9b5860..f543182d 100644 --- a/login-workflow/src/screens/LoginScreen/LoginScreen.tsx +++ b/login-workflow/src/screens/LoginScreen/LoginScreen.tsx @@ -96,8 +96,8 @@ export const LoginScreen: React.FC> = (async (username: string, password: string, rememberMe: boolean): Promise => { try { setIsLoading(true); - await actions.logIn(username, password, rememberMe); await props.onLogin?.(username, password, rememberMe); + await actions.logIn(username, password, rememberMe); } catch (_error) { triggerError(_error as Error); } finally { From c0f9fd22c78ec3a032ca94046a5aa32e82fd5f90 Mon Sep 17 00:00:00 2001 From: shubham-eaton Date: Mon, 11 Nov 2024 18:25:12 +0530 Subject: [PATCH 2/3] Added keyboard dismiss function on login and rememberMe click --- login-workflow/src/screens/LoginScreen/LoginScreen.tsx | 2 +- login-workflow/src/screens/LoginScreen/LoginScreenBase.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/login-workflow/src/screens/LoginScreen/LoginScreen.tsx b/login-workflow/src/screens/LoginScreen/LoginScreen.tsx index f543182d..4a9b5860 100644 --- a/login-workflow/src/screens/LoginScreen/LoginScreen.tsx +++ b/login-workflow/src/screens/LoginScreen/LoginScreen.tsx @@ -96,8 +96,8 @@ export const LoginScreen: React.FC> = (async (username: string, password: string, rememberMe: boolean): Promise => { try { setIsLoading(true); - await props.onLogin?.(username, password, rememberMe); await actions.logIn(username, password, rememberMe); + await props.onLogin?.(username, password, rememberMe); } catch (_error) { triggerError(_error as Error); } finally { diff --git a/login-workflow/src/screens/LoginScreen/LoginScreenBase.tsx b/login-workflow/src/screens/LoginScreen/LoginScreenBase.tsx index afed943a..ddfd0f4c 100644 --- a/login-workflow/src/screens/LoginScreen/LoginScreenBase.tsx +++ b/login-workflow/src/screens/LoginScreen/LoginScreenBase.tsx @@ -3,7 +3,7 @@ import { LoginScreenProps } from './types'; import { WorkflowCard } from '../../components/WorkflowCard'; import { WorkflowCardBody } from '../../components/WorkflowCard/WorkflowCardBody'; import { ErrorManager, PasswordTextField } from '../../components'; -import { Image, View, StyleSheet, ViewStyle } from 'react-native'; +import { Image, View, StyleSheet, ViewStyle, Keyboard } from 'react-native'; import { Button, Checkbox, HelperText, Text, TextInput } from 'react-native-paper'; import { useExtendedTheme } from '@brightlayer-ui/react-native-themes'; import { useScreenDimensions } from '../../hooks/useScreenDimensions'; @@ -200,6 +200,7 @@ export const LoginScreenBase: React.FC }; const handleRememberMeChanged = (value: boolean): void => { + Keyboard.dismiss(); if (onRememberMeChanged) { onRememberMeChanged(value); setRememberMe(value); @@ -213,6 +214,7 @@ export const LoginScreenBase: React.FC isPasswordValid; const handleLogin = (): void => { + Keyboard.dismiss(); if (isFormValid() && onLogin) void onLogin(username, password, rememberMe); }; const handleLoginSubmit = (): void => { From 3df79f455a16f8fe57576e6504452c1955855fb9 Mon Sep 17 00:00:00 2001 From: shubham-eaton Date: Tue, 12 Nov 2024 11:41:54 +0530 Subject: [PATCH 3/3] Package updated to alpha --- login-workflow/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/login-workflow/package.json b/login-workflow/package.json index 85e37dce..4d0bdc82 100644 --- a/login-workflow/package.json +++ b/login-workflow/package.json @@ -1,7 +1,7 @@ { "name": "@brightlayer-ui/react-native-auth-workflow", "description": "Re-usable workflow components for Authentication and Registration within Eaton applications.", - "version": "7.0.1", + "version": "7.0.1-alpha.0", "license": "BSD-3-Clause", "author": { "name": "Brightlayer UI",