react-native-progress-steps
react-native-progress-steps copied to clipboard
Is there a way to hide the button row behind the keyboard? Or in the end of the scroll.
I would like that the previous and next buttons to stay behind the keyboard, instead of above it. Thats because the next button can confuse the user while he's filling a form whit many TextFields, and it also takes some space.
Is there a way to make the button row to behave like content of the steps, only showing in the end of the scroll?
I was able to accomplish this behavior by adding an event listener to the core Keyboard component to toggle the ProgressStep prop removeBtnRow
. https://github.com/colbymillerdev/react-native-progress-steps#progress-step-component
Something like:
function SomeComponent() {
const [buttonsVisible, setButtonsVisible] = useState(false)
useEffect(() => {
const showSubscription = Keyboard.addListener("keyboardDidShow", () => {
setButtonsVisible(true);
})
const hideSubscription = Keyboard.addListener("keyboardDidHide", () => {
setButtonsVisible(false)
})
return () => {
showSubscription.remove();
hideSubscription.remove();
}
}, [])
return (
<ProgressStep removeBtnRow={buttonsVisible}></ProgressStep>
)
}
Hope this helps!
Thanks @neilbateman, This worked for me