Giter VIP home page Giter VIP logo

Comments (13)

violabg avatar violabg commented on August 17, 2024 6

We definitely need a way to close the dropdown even if you don't select an option, either by clicking outside or via a cancel button

from react-native-multiple-select.

ashraf-ainia avatar ashraf-ainia commented on August 17, 2024 5

I just found this workaround using the component callbacks using the React functional component:
first, you have to wrap your main screen with the TouchableWithoutFeedback component.

const multiSelectRef = useRef();
const closeMultiSelectIfOpened = () => {
    if (multiSelectRef.current.state.selector) {
      multiSelectRef.current._toggleSelector();
    }
  }

return(
<TouchableWithoutFeedback onPress={closeMultiSelectIfOpened}>
  <View style={styles.screen}>
        <View style={{ flex: 1 }}>
            <MultiSelect ref={multiSelectRef} ........ />
         </View>
          ...............
   </View>
</TouchableWithoutFeedback>
);

from react-native-multiple-select.

mehranali12 avatar mehranali12 commented on August 17, 2024 1

no work

from react-native-multiple-select.

msafayasar avatar msafayasar commented on August 17, 2024

Did you find a solution?

from react-native-multiple-select.

lucifurtun avatar lucifurtun commented on August 17, 2024

Is there any plan to fix this issue ?

from react-native-multiple-select.

toystars avatar toystars commented on August 17, 2024

Please use the latest version. There ought to be a dropdown icon that can be pressed to close the dropdown

from react-native-multiple-select.

lucifurtun avatar lucifurtun commented on August 17, 2024

@toystars, you mean 0.4.4 ? I don't see one. Btw, I'm talking about single mode.

from react-native-multiple-select.

toystars avatar toystars commented on August 17, 2024

@lucifurtun yes, the latest version is 0.4.4. The close icon should also work in single mode

from react-native-multiple-select.

kristkirp avatar kristkirp commented on August 17, 2024

@toystars, I don't see either the close icon, what's the prop i can use to close?

from react-native-multiple-select.

ngaller avatar ngaller commented on August 17, 2024

With hideSubmitButton it allows closing the dropdown by tapping the arrow, but I am still looking for a way to automatically close it when tapping outside of the selection box

from react-native-multiple-select.

Pravin-L avatar Pravin-L commented on August 17, 2024

Is any body got solution?

from react-native-multiple-select.

 avatar commented on August 17, 2024

I just found this workaround using the component callbacks using the React functional component:
first, you have to wrap your main screen with the TouchableWithoutFeedback component.

const multiSelectRef = useRef();
const closeMultiSelectIfOpened = () => {
    if (multiSelectRef.current.state.selector) {
      multiSelectRef.current._toggleSelector();
    }
  }

return(
<TouchableWithoutFeedback onPress={closeMultiSelectIfOpened}>
  <View style={styles.screen}>
        <View style={{ flex: 1 }}>
            <MultiSelect ref={multiSelectRef} ........ />
         </View>
          ...............
   </View>
</TouchableWithoutFeedback>
);

i change to: <MultiSelect onToggleList={() => closeMultiSelectIfOpened()} ........ />
it work with me

from react-native-multiple-select.

xgokhankose avatar xgokhankose commented on August 17, 2024

I just found this workaround using the component callbacks using the React functional component: first, you have to wrap your main screen with the TouchableWithoutFeedback component.

const multiSelectRef = useRef();
const closeMultiSelectIfOpened = () => {
    if (multiSelectRef.current.state.selector) {
      multiSelectRef.current._toggleSelector();
    }
  }

return(
<TouchableWithoutFeedback onPress={closeMultiSelectIfOpened}>
  <View style={styles.screen}>
        <View style={{ flex: 1 }}>
            <MultiSelect ref={multiSelectRef} ........ />
         </View>
          ...............
   </View>
</TouchableWithoutFeedback>
);

its working but flatlist scroll working so slowly , anyone know ?

from react-native-multiple-select.

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.