Clicking on elements within a Scrollview does not work when the Scrollview is set to an

Currently, I am facing an issue with my Scrollview as its children are not clickable despite having a position of absolute. Click events seem to just pass through them and interact with components below. I have searched extensively for a solution online, but there aren't many helpful resources available. One suggestion I came across was to set the height of the scrollview explicitly. I also tried adding elevation, but it had no effect. Unfortunately, I have not been able to find any other viable solutions.

This problem seems to be specific to Android, as I am unable to test it on iOS at the moment.

export const Component: FC = ({}) => {
    const popUpRender = () => {
        return [
            durations.map(duration => {
                return (
                    <TouchableOpacity
                        key={duration}
                        onPress={() => {
                            console.log('clicked')
                        }}>
                        <Text>text</Text>
                    </TouchableOpacity>
                )
            }),
        ]
    }

    return (
        <View style={styles.container}>
            <ScrollView style={[styles.popUp]}>{popUpRender()}</ScrollView>
        </View>
    )
}

const styles = StyleSheet.create({
    container: {
        flexDirection: 'row',
        zIndex: 11,
    },
    popUp: {
        position: 'absolute',
        elevation: 5,
        zIndex: 100,
        width: '100%',
        height: 200,
        backgroundColor: 'white',
    },
})

I must maintain the scrollview's absolute position. Is there a way to ensure its children remain clickable?

Answer №1

Is there a specific reason why the scrollview needs to be positioned absolutely?

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Targeting child elements with CSS selectors

In my ecommerce software, I have a menu that I want to customize by making the main categories bold. I have attempted various methods, including the ones shown below, but I am struggling to target the correct elements (specifically those in capital letter ...

How can I create a DIV element that consistently shows text when clicked?

Is there a way to achieve this effect using just CSS and HTML? When clicking on the question text, it should reveal the answer below, and clicking again should hide the answer. I have managed to make it work with hover, but I am unsure how to implement it ...

Using the ico-moon icon in an HTML email for various email clients such as Outlook and Gmail

I would greatly appreciate it if someone could provide instructions on how to incorporate ico-moon icons into an email HTML, ensuring they can be properly displayed in various email clients such as Outlook and Gmail. ...

Techniques for breaking down large CSS files into modules and combining multiple smaller CSS files

My website's CSS file is currently massive, containing site-wide selectors in a file named Mondo.css. While this setup has been effective for ensuring users only need to download the file once, I've recently developed a widget that requires its o ...

Adjust the height of videos automatically on columns

I need help figuring out how to display two videos with different dimensions side by side without any weird gaps. I've already tried using flex display with no luck. My current code looks like this: <div class="row"> <d ...

Horizontal Screen Sharing on iPad

Currently, I have a two-column website set up using Wordpress. However, I am facing an issue with the right side column scrolling over on iPads. While the page behaves properly on desktops, on iOS devices, the div is able to scroll over the navigation ba ...

What could be the reason the "npx expo start" command isn't functioning as expected?

Recently, I've encountered an issue with the npx expo start command while working on my amateur projects using Expo. Up until now, everything has been running smoothly with no complications. However, at this moment, the npx expo start command seems t ...

Ways to style a div element in CSS to achieve a unique shape

Hello there! I'm looking to achieve a tilted background div effect. Anyone have any tips or ideas on how I can do this? I'm new to web development and would appreciate the guidance. https://i.stack.imgur.com/wyj1X.png ...

Issues with table-cell rendering in Chrome

I have three different divisions that I would like to showcase as table cells: <div class="field"> <div class="row"> <label for="name">Subdomain</label> <input type="text" id="name" name="name"> &l ...

I struggled to insert a horizontal scrollbar into the iframe

In the process of constructing a family tree, I am utilizing lists as elements to create the structure. However, I am encountering an issue when the tree grows larger - no horizontal scrollbar is appearing. I have attempted to use iframe and CSS to manage ...

Ways to ensure CSS affects icon inside main element?

Struggling to match the background color of Material-UI icons with the rest of the list items on hover. The CSS is not applying to both the icon and text despite styling the overall class (className= "dd-content-item"). Any assistance would be greatly appr ...

Utilize CSS exclusively on the "Theme Options" page within a Wordpress website

Everything is running smoothly with my current PHP code, which controls the design of my "Theme Options" page under the WP API Appearance menu. However... The issue is that the CSS stylesheet is affecting all other menus in the WP dashboard as well, like ...

The element fails to appear on screen when using Firefox

Check out this site using IE or Chrome and pay attention to the yellow block: Then, try opening the same page in Firefox and watch as the block mysteriously vanishes. Does anyone have any idea why this is happening? Did I make a mistake somewhere? ...

Attempting to create a hexagon using 127 divisions results in a gap

I am faced with a challenge of arranging 127 divs to form a hexagon shape similar to the example below: for (i = 1; i <= 127; i++) { var div = document.createElement('div'); document.getElementsByTagName('body')[0].appendChild( ...

When a DIV is clicked, trigger the fadein effect on another DIV; when the same DIV is clicked again, fade

I have a sliding panel on my webpage that reveals the navigation (www.helloarchie.blue). I want the content inside the panel to fade in slowly when it slides out, and then fade out when the user clicks the icon to close the panel. How can I achieve this ef ...

Troubles with Angular elements not aligning correctly when using the "display: block" property

When using an angular element for a directive with "display: block", it may not automatically take up 100% of the width of the parent container. In order to ensure that it does, the width must be explicitly set to "100%" in the CSS. Despite setting "width: ...

Reduce the flexbox container to match the dimensions of its child elements

I have a set of blocks with fixed dimensions that I want to arrange in a grid layout. Using flex-wrap: wrap, I can distribute as many blocks as possible in each row. However, I need the entire wrapped column to be centered on the page, similar to this: ht ...

Set the background of the vue widget to be completely see-through

I have a project where I am creating a widget using Vuetify, and embedding it into another website in the following way: <!DOCTYPE html> <html lang="en"> <head> <link rel="stylesheet" href="component-styl ...

Text that is not aligned in the middle and has a colored background

After setting up a flexbox container with some flex-items, I encountered an issue: When clicking on either "Overview" or "Alerts", the white background border is not displayed. To highlight the selected item, a class called .selected is triggered which ad ...

Using JavaScript, HTML, and CSS to select slices of a donut pie chart created with SVG

I have successfully implemented CSS hover effects and can manipulate the HTML to use the .active class. However, I am facing difficulties in making my pie slices switch to the active state upon click. Moreover, once this is resolved, I aim to enable select ...