It seems that Firefox is ignoring the word-wrap style when the class of a child element is changed

Take a look at this:

var iconIndex = 0;
  var icons = ['check', 'chain-broken', 'flag-o', 'ban', 'bell-o'];

  $('button:eq(0)').click(function() {
    iconIndex = (iconIndex + 1) % icons.length;
    $('#dev-0 .status-icon').attr('class', 'status-icon fa fa-fw fa-' + icons[iconIndex]);
  });
ul {
  width: 200px;
  border: 1px dotted #ccc;
}
.device-list-item {
  max-height: 31px;
  overflow: hidden;
  word-break: break-all;
}
a {
  position: relative;
  display: block;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/css/tether.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css" rel="stylesheet" />

<ul class="nav">
  <li id="dev-0">
    <a href="#" class="device-list-item">
      <span>
        <i class="status-icon fa fa-fw fa-bell-o"></i>
        <span>Firstwordhere Secondwordhere</span>
      </span>
    </a>
  </li>
</ul>

<button>Click me</button>

(Well, it seems that the Snippets feature causes this to happen before the button is clicked. If you want to check it out, you can do so on JSFiddle here)

By clicking the button, the icons should cycle through, but in Firefox only, the "second word" is also removed. It appears that the word wrapping is changing, causing the second word to drop down to an [invisible] second line. Toggling the word-break: break-all property off then back on using the debugger restores the initial state.

What could be the cause of this issue? Is it related to incorrect HTML/styles or a bug in Firefox?

And how can I address this with minimal modifications?

This issue occurs in Firefox versions 50.1.0 and 51.0.1; it works fine in Chrome 55 and IE 11 (all on Windows 7).

Answer №1

I suspect that the issue at hand can be pinpointed to Chrome bug 84345, a problem that is rumored to have been resolved in version 80 (expected release date: March).

Confirming this, I have verified that it functions correctly on Chrome Canary 80.0.3987.0 as of today.

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

Issue: [$injector:unpr] Provider not found: RequestsServiceProvider <- RequestsServiceFor more information on this error, please visit the website: http://errors.angularjs.org

Despite defining my service name in all necessary places, I am still encountering the error mentioned above. Below is my app.js: var app = angular.module('ionicApp', [ 'ionic', 'ngCordova', 'checklist-model' ]) ...

I made a request using the post type fetch to submit data to this form, but unfortunately, the server-side response returned

I encountered an issue where after sending the post type fetch to this form, I received 'undefined' on the server side. Here's the code snippet for my fetch request: const { text, id } = Data; fetch('http://localhost:3001/add' ...

Compilation unsuccessful. The LineGraph.js module could not be located due to recursion in resolving

After successfully installing react-chartjs-2 and chart.js using the command npm install --save react-chartjs-2 chart.js, I encountered an error when attempting to use LinkGraph: Failed to compile. ./src/LineGraph.js Module not found: Recursion in resolvi ...

Populate a MySql database with 2 input values

I am facing an issue with inserting values into MySql from a table. When trying to insert two values, only one gets stored in the database and the other remains empty. Here is the structure of my MySql table: Below is the HTML code for my table: <tab ...

The conversion of a 2D json array into a string is mistakenly performed

On hand is an outer array that contains 2 arrays within it, making it a 2-dimensional array. This is how the array is initialized: $outerArray = array(); $nestedArray = array("first", "second", "third", "fourth"); $outerArray[] = $nestedArray; $nest ...

Arranging elements on a webpage using CSS grid placements

Currently experimenting with css grid, envisioning a scenario where I have a 2x2 grid layout. When there are 4 child elements present, they would form 2 rows of 2 elements each. My challenge is when dealing with an odd number of children, I aim to avoid al ...

gulp-open not functioning properly following the use of createWriteStream

I am utilizing gulp, gulp-eslint, and gulp-open to generate a report detailing ESLint outcomes. The linting and file creation processes function correctly; however, the task aimed at opening the file containing my report encounters issues. gulp.task(&apos ...

How can you hide all siblings following a button-wrapper and then bring them back into view by clicking on that same button?

On my webpage, I have implemented two buttons - "read more" and "read less", using a Page Builder in WordPress. The goal is to hide all elements on the page after the "Read More" button upon loading. When the button is clicked, the "Read More" button shoul ...

Is there a way to trigger a click event on an href using asp code behind?

Is there a way to programmatically trigger a click event on the href "shipping_question_ID_product_received_as_ordered_link" from the code behind of an ASP form? This href triggers a complex function in jquery when clicked by the user. I need to simulate ...

Discovering the particular component using jQuery

I am currently developing a voting system and would like to incorporate jQuery for its functionality. I have successfully implemented the code for voting on a single page, but my challenge lies in extending this feature to allow users to vote from the main ...

Is there a function for displaying the message "User is currently typing"?

I've been working on a chat system in PHP/jQuery, where the message 'User is typing a message...' appears at the bottom. Despite trying numerous methods, I have yet to succeed. My chat system utilizes PHP, MySQL, Ajax, and jQuery. While I&a ...

Show information from database in a drop-down menu utilizing jQuery

tbl_fruits id | name | 1 | banna | 2 | apple | 3 | orange | 4 | kiwi | Currently, I have an HTML script that includes a form for adding users: <form id="form-add_users" autocomplete="off"> &l ...

How to fetch a pre-existing file with CodeIgniter

Currently, I am in the process of creating a website that allows users to download jpg, png, pdf, and docx files uploaded by an administrator. The file uploading functionality is working smoothly without any issues. Upon uploading a file, its name is stor ...

Issues with the positioning of JQueryUI Dialog components are causing unexpected behavior

Utilizing JQueryUI Dialog, I have implemented the following function: <script> $(document).ready(function() { $('#dialog').dialog({ autoOpen:false, width:100, height:200, ...

Issues have arisen in IE8 with the background gradient on hover elements in the menu, while it functions properly in all other web browsers

Welcome to the website: I've recently taken on a project involving the gradiated menu on this site. The menu works flawlessly in Firefox, Chrome, and Safari - the hover effect changes the background color to a light gradiated green. However, when it ...

Troubleshooting: Issues with jQuery Validate plugin's rules method in Javascript

I'm encountering an issue with a simple javascript file that is supposed to run the rules method, but it's not working as expected. I have confirmed that my custom javascript file is being rendered correctly since input masking is functioning pro ...

What is causing the geolocation heading to remain "null" on Android devices when using Chrome?

Recently, I developed a compact geolocation watch using the following code snippet: navigator.geolocation.watchPosition( this.updateLocation.bind(this), this.errorLocation.bind(this), {enableHighAccuracy: true} ); The function updateLocation ...

CSS for Responsive Web Development: Adjusting the Height of Mobile Sliders

I've been working on adjusting the height of the slider on my website for mobile screens, but I can't seem to get it right. The website in question is www.msstoreway.com. Despite adding the CSS code below, I was able to adjust the slider height ...

Reduce the count of products when the button is clicked

Hey there! I'm running a special promotion on my website with limited spots available at a reduced price. I'd love to have a real-time counter that shows the number of remaining spots, decreasing by one each time someone clicks the 'sign up& ...

What impact do negative positioning have on CSS elements in terms of responsibility?

Just diving into CSS and I have a question to pose: Is it considered good practice to utilize negative positioning in CSS? Are there potential compatibility issues with browsers like IE7 and IE8? What is your suggestion? #example-bottom { position: relat ...