? Pending

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
16 Aug 2019

Pull Request for Issue #25872

Summary of Changes

As title says. There is no way to differentiate top menu items when they are disabled.

Testing Instructions

Edit an article.

before patch

Screen Shot 2019-08-16 at 18 03 56-before

After patch

Screen Shot 2019-08-16 at 18 06 18-after

@C-Lodder

avatar infograf768 infograf768 - open - 16 Aug 2019
avatar infograf768 infograf768 - change - 16 Aug 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 16 Aug 2019
Category Administration Templates (admin)
avatar richard67 richard67 - test_item - 16 Aug 2019 - Tested successfully
avatar richard67
richard67 - comment - 16 Aug 2019

I have tested this item successfully on 01a02ab

Works like a charm.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25906.

avatar dgrammatiko
dgrammatiko - comment - 17 Aug 2019
avatar brianteeman
brianteeman - comment - 17 Aug 2019

@dgrammatiko Why? There isnt anything using pointer events then as far as I can tell

avatar dgrammatiko
dgrammatiko - comment - 17 Aug 2019

@brianteeman if I m not wrong devs can append links and buttons in that position as well. This is just a fail-safe for any appended link that needs to be disabled but the dev thinks that the reduced opacity also means not working links. In a perfect world that wouldn't be needed but let's be realistic here...

avatar brianteeman
brianteeman - comment - 17 Aug 2019

I think you are confusing cursor and pointer

avatar dgrammatiko
dgrammatiko - comment - 17 Aug 2019

The cursor is all about the visual representation of the cursor, the pointer-events is about removing the click functionality. Probably both are needed but the essential is the pointer-events as it will trully disable the functionality of those btns/links

avatar infograf768 infograf768 - change - 17 Aug 2019
Labels Added: ?
avatar brianteeman
brianteeman - comment - 17 Aug 2019

How are they not disabled now?

avatar infograf768
infograf768 - comment - 17 Aug 2019

So, shall I add:

cursor: not-allowed;
pointer-events: none;
avatar brianteeman
brianteeman - comment - 17 Aug 2019

I do not see the need for the pointer-events line - that's disabling something that is already disabled

avatar dgrammatiko
dgrammatiko - comment - 17 Aug 2019

that's disabling something that is already disabled

It's already disabled for the core but what I'm suggesting will also disable, by default without extra code, 3rd PD buttons/links published in that position. It's about dev ergonomics

avatar brianteeman
brianteeman - comment - 17 Aug 2019

It should be the responsibility of the dev to choose if their stuff is enabled or disabled not just because it is in position x

avatar dgrammatiko
dgrammatiko - comment - 17 Aug 2019

@brianteeman the problem is that if they have a link (and obviously they wanted to tight it to the hiddenMenu) their course of action could be either:

  • not echoing the link at all
  • add some js to actually disable the link

By having this simple css you make peoples life easier by simply disabling tap/clink on links and buttons. Also, it's not that it gonna make any difference the delivered css in the backend is already around 1/2 a meg, so adding one more line won't make a difference

avatar brianteeman
brianteeman - comment - 17 Aug 2019

The problem is that you are forcing it to be disabled - it should be the developers choice. They might have a very good reason for it to be enabled

avatar dgrammatiko
dgrammatiko - comment - 17 Aug 2019

The problem is that you are forcing it to be disabled

You're missing the point mate. This behaviour is coupled to a class disabled. Now tell me that the disabled class should be interpreted as visual-disabled and not as actually disabled... (it doesn't affect the normal links/button in that position header)

avatar richard67 richard67 - test_item - 18 Aug 2019 - Tested successfully
avatar richard67
richard67 - comment - 18 Aug 2019

I have tested this item successfully on ead86c5


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25906.

avatar wilsonge
wilsonge - comment - 18 Aug 2019

@brianteeman @dgrammatiko so the proposition as i understand is that if a developer chooses to have their content disabled, by using the disabled class (e.g. here https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/modules/mod_user/tmpl/default.php#L21 ) then in the SCSS block response for disabled here https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/templates/atum/scss/blocks/_header.scss#L109-L115 we'd add pointer-events: none; which would stop any special treatment whilst modules still choose if they want to allow clicks or not by choosing whether they are using the disabled class or not?

If i understand correctly then it makes sense to do it for me?

avatar dgrammatiko
dgrammatiko - comment - 18 Aug 2019

@wilsonge you got it, that was my proposal

avatar brianteeman
brianteeman - comment - 18 Aug 2019

The correct way to disable a button is with the element disabled not the class disabled
A button with a class disabled and pointer-none is not really disabled. It is still has focus. It is still in the accessiblity tree. It will still be announced as a button (with no mention that it is disabled.

avatar brianteeman
brianteeman - comment - 18 Aug 2019

image

image

avatar dgrammatiko
dgrammatiko - comment - 18 Aug 2019

For the button what Brian wrote is correct, but the rule also covers plain links and for those pointer-events is required

avatar brianteeman
brianteeman - comment - 18 Aug 2019

Links

image

avatar dgrammatiko
dgrammatiko - comment - 18 Aug 2019

AFAIK focus cannot be controlled by CSS, so I don't even understand why are we arguing here...

avatar brianteeman
brianteeman - comment - 18 Aug 2019

You are saying that you can just disable something with a class. I am proving that you cannot

avatar dgrammatiko
dgrammatiko - comment - 18 Aug 2019

What you are proving is that the platform doesn't provide any way to do it (only with CSS) in an accessible way. The functionality is disabled but to make it accessible you need to remove the tabindex as well

avatar brianteeman
brianteeman - comment - 18 Aug 2019

All of which makes your suggestion pointless

avatar dgrammatiko
dgrammatiko - comment - 18 Aug 2019

Common sense is not that common, I guess. Have it your way. Unsubscribe

avatar infograf768
infograf768 - comment - 18 Aug 2019

@wilsonge
Please decide if I should modify the PR to any of the proposed suggestions or not.
If not this can be merged.
Imho, if anyone is not happy, another PR can be done later and discussion can be done there.

avatar C-Lodder
C-Lodder - comment - 18 Aug 2019

You don't control what elements (<button> or <a>) are added to the top menu and cannot disable a link with the disabled attribute, so pointer-events: none; should be added just incase a user decides to use <a>

avatar brianteeman
brianteeman - comment - 18 Aug 2019

As stated before

  1. The creator of the link might want it to be enabled
  2. It fails accessibility
avatar C-Lodder
C-Lodder - comment - 18 Aug 2019

@brianteeman in which case at leatst use a:not([target=_blank]) { pointer-events: none; }. If an a user is editing an article and accidentally clicks a link that opens in the same tab, they'll lose their changes

avatar brianteeman
brianteeman - comment - 18 Aug 2019

pointer-events none only has an effect on mouse users

avatar C-Lodder
C-Lodder - comment - 18 Aug 2019

Yup, but better than nothing. You'd have to use JS (event.preventDefault()) if you wish to cater for keyboard users

avatar brianteeman
brianteeman - comment - 18 Aug 2019

i still say it should be the 3pd problem to solve, there is no issue in core

avatar wilsonge
wilsonge - comment - 18 Aug 2019

Modify it please @infograf768

avatar infograf768
infograf768 - comment - 19 Aug 2019

@wilsonge
Done.

Note: when pointer-events: none; is present, then cursor: not-allowed; does not work. Therefore I did not add it.

avatar rdeutz rdeutz - change - 19 Aug 2019
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-08-19 08:40:14
Closed_By rdeutz
avatar rdeutz rdeutz - close - 19 Aug 2019
avatar rdeutz rdeutz - merge - 19 Aug 2019

Add a Comment

Login with GitHub to post a comment