Git Product home page Git Product logo

Comments (4)

ammarahm-ed avatar ammarahm-ed commented on May 10, 2024 2

Also I am pushing a point release to fix a few issues you listed here. Thank you very much for using this library!

from react-native-actions-sheet.

dhuber666 avatar dhuber666 commented on May 10, 2024

I solved it by also give it a custom containerStyle.
But I have a new problem:

When I have a TextInput inside the custom component that pops up and give it the prop autofocus, when I open the modal the keyboard snaps up and then the modal completely disappears, but the keyboard stays open (ios only).

When I close the keyboard and open the modal again, everything works as expected. So the first opening of the modal gives me this strange behavior.

What can I do about it? The code for the component that does all this is in my post above (pastebin).

Ty so much again for this awesome library!

EDIT: Also this is solved. When I put the prop gestureEnabled={false} on my action sheet and headerAlwaysVisible it works as expected.

Except: Ofc I can't now close it with a drag down. That's a bummer.

Also a very minor problem I have is that something is faulty with type declaration because I have this error / warning in vsc (my project uses typescript):

Screenshot at Apr 09 17-31-27

I don't know is it because the types are not complete or am I using the whole thing incorrect? Thx again the third time!

from react-native-actions-sheet.

ammarahm-ed avatar ammarahm-ed commented on May 10, 2024

Hi,

Thank you for opening the issue, I will look into it and report back ASAP.

The link you gave for the code is not working anymore, I think it has expired?

Edit: You were right about the .ts definations, they are incorrect and I will fix them.

You should use the prop initialOffsetFromBottom and set its value to 1 then I think your problem will not take place, since you are using a text input inside it and gestures will work too.

Also I noticed that the onOpen event is not firing which I will fix too. What you can do to handle the textInputs is to listen to the onOpen function. So what you do is hide the textInput when the actionSheet opens, and show it after a minor delay, like 300 or 500ms.

// IN YOUR COMPONENT
const [textInput,setTextInput] = useState(false);


const _onClose = () => {
      setTextInput(false);         
}


return  <ActionSheet
        initialOffsetFromBottom={1}
        ref={ref => (actionSheet = ref)}
        bounceOnOpen={true}
        bounciness={8}
        gestureEnabled={true}
        onClose={_onClose}
        onOpen={() => {
            setTimeout(() => {
              setTextInput(true);
            },500)
        }}
        defaultOverlayOpacity={0.3}>
<View>
{
                    textInput?     <TextInput
                    style={{
                      width: '100%',
                      minHeight: 50,
                      borderRadius: 5,
                      borderWidth: 1,
                      borderColor: '#f0f0f0',
                      marginBottom: 15,
                      paddingHorizontal: 10,
                    }}
                    autoFocus={true}
                    multiline={true}
                    placeholder="Write your text here"
                  /> : null
                  }
</View>
</ActionSheet>

This is only in case your keyboard does not show up at all on opening.

I have tested this on iOS and its working fine on keyboard open.

The white margin you are seeing is the footer. You need to use the footerStyle and set its background to your backgroundColor or the containerStyle prop. Since you are setting the backgroundColor of your customComponent, the top and bottom is white as I can see.

from react-native-actions-sheet.

ammarahm-ed avatar ammarahm-ed commented on May 10, 2024

I am closing this issue for now, if you face any problem, you can open it again or create a new one.

from react-native-actions-sheet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.