Maybe a bit weird request :D

From #2815269: Dropdown does not remove HTML when creating options:

-        $option.html($link.html());
+        $option.html($link.text().trim());

The issue is that .trim() removes non-breaking spaces as well.

At our project we use non-breaking spaces to display facets in hierarchy. Not sure whether there can be other use cases, but it will do absolutely no harm if we remove .trim(). Browsers will trim leading/ending spaces anyway when displaying text from select options.

CommentFileSizeAuthor
#2 2850785-2.patch409 bytesLeksat
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Leksat created an issue. See original summary.

Leksat’s picture

Assigned: Leksat » Unassigned
FileSize
409 bytes
Leksat’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: 2850785-2.patch, failed testing.

Leksat’s picture

Status: Needs work » Needs review
borisson_’s picture

Makes sense, thanks!

  • borisson_ committed 432a462 on 8.x-1.x authored by Leksat
    Issue #2850785 by Leksat: Remove .trim() from dropdown widget JS
    
borisson_’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.