question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

Select component not working inside modal

See original GitHub issue

šŸ› Bug Report

Select component is not working inside react-nativeā€™s modal. The options are rendered under the modal, so no items can be selected.

Select does not show options: photo6014672313443791435

With opacity, the problem can be noticed: photo6014672313443791434

To Reproduce

Put Select component inside a modal.

Expected behavior

Select component should work inside modal.

Link to runnable example or repository (highly encouraged)

import React from "react";
import { View, Modal } from "react-native";
import {
  ApplicationProvider,
  Layout,
  Text,
  Select,
} from "@ui-kitten/components";
import { mapping, light as lightTheme } from "@eva-design/eva";

const data = [{ text: "Option 1" }, { text: "Option 2" }, { text: "Option 3" }];

const HomeScreen = () => (
  <Layout>
    <Modal visible transparent>
      <View
        style={{
          flex: 0,
          padding: 100,
          backgroundColor: "red",
          opacity: 0.5,
        }}
      >
        <Select data={data} onSelect={() => 0}></Select>
        <Text style={{ marginTop: 10 }}>
          Cannot select modals. The options are rendered under the modal.
        </Text>
      </View>
    </Modal>
  </Layout>
);

const App = () => (
  <ApplicationProvider mapping={mapping} theme={lightTheme}>
    <HomeScreen />
  </ApplicationProvider>
);

export default App;

UI Kitten and Eva version

Package Version
@eva-design/eva 1.4.0
@ui-kitten/components 4.4.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7

github_iconTop GitHub Comments

11reactions
jaredswensoncommented, Nov 18, 2021

Is there a solution for this?

9reactions
Frans-Lcommented, Mar 16, 2020

Thatā€™s unfortunate, since the native modalā€™s (especially react-native-modalā€™s) animation features outperform UI Kittenā€™s version.

Would you @artyorsh be interested in a pull request that adds support to native modals? It would mean that you could add a separate component inside native modal that renders UI Kittenā€™s modal inside native modal.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bootstrap-select not working inside modal
You have to reinitialize your Bootstrap-Select (.selectpicker) after loading your modal. The reason why this is happening is, your modal isĀ ...
Read more >
Select component inside modal
I want to use the new select component inside a modal. The dropdown is not working like accepted. Generally it's there and I...
Read more >
Angular Material Select wont open on modal - Experts Exchange
I have a modal form with a Angular Material dropdown select control that doesnt show the options if i place it on a...
Read more >
react-select-in-modal
@atlaskit/modal-dialog. 10.0.6 Ā· react. ^16.2.0 (16.14.0) Ā· react-dom. ^16.2.0 (16.14.0) Ā· react-select. 3.0.4 Ā· styled-components.
Read more >
Common problems
Select2 does not function properly when I use it inside a Bootstrap modal. ... This issue occurs because Bootstrap modals tend to steal...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found