The CSS property pointer-events: none does not seem to be functioning properly on a contenteditable

Within a parent div element, the pointer-events property is set to none. Inside this div, there is a span element with the contenteditable attribute set to true. Surprisingly, I can still edit the content of the span element in Chrome despite the pointer-events for the parent div being disabled.

Conversely, in Firefox, the behavior is as expected, and I am unable to edit the span's content.

You can view the result here

Here is the code snippet:

<style>
.item-disabled{
    opacity: 0.3;
    pointer-events: none;
}
.media, .media-body, .media-heading{
    padding: 15px;
}
.list-unstyled{
    padding-left: 0;
    list-style: none;
    margin-left: -5px;
}
</style>

<div class="item-disabled">
    <li class="media">
        <div class="media-body">
            <div class="media-heading">
                <ul class="list-unstyled">
                    <li><span  contenteditable="true">Editable Span Content</span></li>
                </ul>
            </div>
       </div>
    </li>
</div>

Answer №1

In my opinion, Chrome seems to be experiencing some instability when using the pointer-events element, whereas Firefox appears to be more reliable.

According to the MDN documentation, Firefox is considered to be a more stable and compatible option compared to Chrome for implementing pointer-events. https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events

It might be advisable to consider using Edge for displaying this feature as it tends to be more compatible. Alternatively, utilizing a different element to replace the feature could be an interim solution until compatibility between Chrome and Firefox improves in the future.

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

Simple method to modify the text size of the entire HTML page

Looking for a way to adjust the font size of an entire HTML document? I'd like to have two buttons - one to increase the font size and the other to decrease it. Each button will trigger a JavaScript function; function increaseFontSize(){ //Increase ...

Issue with vertical cell alignment in MUI x-data-grid persists following the latest update to version 7.2.0

After updating my MUI app to the latest npm packages version, specifically upgrading x-data-grid from 5.17.9 to 7.2.0, I encountered an issue. In my application, I utilize a grid where certain columns are populated using the renderCell property: const cel ...

Generating a JSon output that contains HTML table data specifically meant to be seen within the fnopen callback function of a jQuery datatable

After spending countless hours searching for a solution to my problem, I decided to take matters into my own hands. The issue at hand revolves around a jQuery datatable that showcases various aspects of a resolver's case load. Claim ID Claimant Nam ...

Modifying the default text within a select box using jQuery

Within a select box identified as 'edit-field-service-line-tid', there is default text displayed as '-Any-'. This particular select field has been generated by Drupal. I am looking to use jQuery to change the text '-Any-' to ...

E-store product divisions in sync

I am currently working on an e-shop project using TYPO3 CMS. One of the issues I am facing is with the formatting of the product list (when clicking on all products). The beginnings of categories appear with varying spacing. Take a look at this picture for ...

What is the process for using jQuery to systematically alter the src attribute of all avatar images on Twitter.com?

Summary: I am learning JavaScript and jQuery, and wanted to write a script to replace "_normal.png" with ".png" for all "img.avatar" images on Twitter.com. I encountered an error which I will explain below. Background: Practice makes perfect, so I like to ...

To ensure proper display, the canvas should be set to display block when its width is 100vw and height is 100vh

Can anyone explain why I need to include display: block when my canvas is full page? Without it, the canvas size appears larger even though the width and height values are the same. Appreciate any insights. Thanks! ...

Steps to create a basic multi-select dropdown menu with Select2

I have decided to integrate the select2 library into my HTML document because it offers a sleek pillbox style select control that fits well with my design. After carefully following the instructions in the Installation and Getting Started sections of the ...

Menu overlay conceals company logo

On smaller screen sizes, my hamburger menu is blocking part of the logo. I'm struggling to figure out how to ensure that the logo appears in front of the menu before it is clicked. Here's an example. I attempted setting the background of label . ...

Looking to design a popup using CSS styles

How can I design a pop-up window using CSS for a specific div? I also want to display additional information within another div inside the popup. ...

Developing HTML functionalities within the OneNote Add-in API

I have developed my own OneNote Add-in using Nodejs, but I am encountering two issues that I have been unable to resolve despite extensive research. The add-in I created adds a new outline to a OneNote page, which includes an HTML table with one column an ...

Executing JavaScript function from external SVG file globally

I am working on an HTML page that includes an external JavaScript module <script type="text/javascript" src="js/js.js"></script> and also an external SVG map called "img/map.svg". My goal is to create clickable objects on the map that will t ...

Instructions for connecting a button and an input field

How can I connect a button to an input field? My goal is to make it so that when the button is clicked, the content of the text field is added to an array (displayed below) const userTags = []; function addTags(event) { userTags.push(event.target.__ wha ...

What methods can be used to limit URL abbreviations on my website?

I need a simple solution that I have been struggling to figure out. What I want is for anyone attempting to access any webpage directly on my website to be automatically redirected to the home page. For instance, if someone tries to access www.domain-name ...

Conceal the choice if its value matches that of another option

My goal is to create a code that will hide an <option> if its value matches the value of the first option (which is retrieved dynamically with PHP). Here's the initial code snippet: <select onChange="this.form.submit()" name="cart[<?php e ...

Struggling to implement a vertical scroll bar in HTML code?

<body ng-app="myApp" ng-controller="myCtrl"> <div ng-show = "dataFromRest" ng-repeat = "x in dataFromRest.posts" > <div class="tittle" style="width: 25%;"> <a href="" ng-click="showDi ...

The issue with property unicode malfunctioning in bootstrap was encountered

I have tried to find an answer for this question and looked into this source but unfortunately, when I copy the code into my project, it doesn't display Unicode characters. section { padding: 60px 0; } section .section-title { color: #0d2d3e ...

Can you answer this straightforward query about CSS positioning?

I am currently facing a challenge in creating a small div (header class) that overlays a main banner image div (banner class). When I maximize my browser window, the positioning is correct. However, upon resizing the browser, the header div maintains its m ...

Enhance user experience with hover-over tooltips

Is it possible to add tooltips to select options when hovering over them, especially when the select box width is decreased? <html> <head> <title>Select box</title> <body> <select data-val="true" data-val-number="The ...

Revolutionizing user experience: New feature seamlessly triggers button actions with the power of "enter"

I need assistance with modifying a form that contains two buttons and several text inputs. Currently, if the enter key is pressed, it triggers a click event on the first button. However, I want to modify this behavior so that if any of the text boxes are f ...