Opened 2 years ago

Closed 21 months ago

Last modified 19 months ago

#16810 closed defect (bug) (fixed)

hide-if-no-js not working on Most Used link

Reported by: deepak.seth Owned by: azaozz
Priority: normal Milestone: 3.3
Component: Administration Version:
Severity: minor Keywords: has-patch 3.3-early
Cc: azizur

Description

The Most Used link of hierarchical taxonomy like Category is shown on Post page with Java script disabled, which should get hidden by default.
The tab has hide-if-no-js class but it gets overridden with display:inline somehow.

Also shows on WordPress.com sites.

Attachments (2)

16810.diff (420 bytes) - added by solarissmoke 2 years ago.
make sure -no-js styling doesn't get overridden by more specific instructions elsewhere
16810.patch (705 bytes) - added by SergeyBiryukov 21 months ago.

Download all attachments as: .zip

Change History (16)

comment:1 follow-up: ↓ 2   hakre2 years ago

Can you add a link on a wp.org install to reproduce it more easily?

comment:2 in reply to: ↑ 1   deepak.seth2 years ago

Replying to hakre:

Can you add a link on a wp.org install to reproduce it more easily?

To recreate the problem: disable the javascript->open the add new post page->here you can see the most used link on category widget,though i think it shouldn't be visible and it doesn't work either.

make sure -no-js styling doesn't get overridden by more specific instructions elsewhere

  • Keywords has-patch added
Version 0, edited 2 years ago by solarissmoke (next)
  • Keywords 3.3-early added
  • Milestone changed from Awaiting Review to Future Release

I'm comfortable with this patch. Early 3.3.

  • Cc azizur added
  • Milestone changed from Future Release to 3.3

I'm generally very much against using !important anywhere but perhaps it's warranted in this case.

  • Owner set to azaozz
  • Resolution set to fixed
  • Status changed from new to closed

In [18664]:

Make hide-if-no-js and hide-if-js important, props solarissmoke, fixes #16810

Turns out this causing some undesirable side-effects, maybe !important is a bad idea after all. See #18656.

  • Resolution fixed deleted
  • Status changed from closed to reopened

So this probably should be fixed on a case-by-case basis.

16810.patch fixes the initial reported issue with the "Most Used" link.

When I looked into this the first time I found at least 3-4 other cases where the same thing was happening. I can't remember where they were now but will see if I can find them.

Fixing them on a case-by-case basis is going to be tedious to maintain, because any change to the specificity of the selectors in future could cause the problem to resurface. That said, I can't think of a less awkward solution either.

  • Resolution set to fixed
  • Status changed from reopened to closed

In [18668]:

Revert [18664] and handle any similar cases separately, props SergeyBiryukov, fixes #16810, fixes #18656

In [19179]:

Only hide "Most Used" category tab when the body has .no-js class. See #16810, fixes #19129.

Note: See TracTickets for help on using tickets.