? Pending

User tests: Successful: Unsuccessful:

avatar N6REJ
N6REJ
11 Sep 2019

Pull Request for Issue # .

Summary of Changes

adds aria-current="page" to active menu item.

Testing Instructions

select a menu item to make it active.
view source for active menu item.
should look like "actual result" image.
apply patch
aria-current="page" should be before the > in the anchor for the "active" menu item.
as shown in the "expected result" image.

Now select or create as needed a alias menu item
repeat above steps.

Expected result

image

Actual result

image

Documentation Changes Required

None

avatar N6REJ N6REJ - open - 11 Sep 2019
avatar N6REJ N6REJ - change - 11 Sep 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 11 Sep 2019
Category Modules Front End
avatar N6REJ N6REJ - change - 11 Sep 2019
Labels Added: ?
avatar brianteeman
brianteeman - comment - 11 Sep 2019

The right idea but completely the wrong implementation ;)

You just need to use an aria attribute called aria-current on the active link - in this case it would be aria-current="page"

See https://tink.uk/using-the-aria-current-attribute/

note this needs to be done in j4 admin menu as well if you want to submit a pr for that

avatar N6REJ
N6REJ - comment - 11 Sep 2019

aria-current="page"

ok, as soon as I figure out why GIT is telling me to flack off I'll try to fix it.. ty.

avatar N6REJ N6REJ - change - 11 Sep 2019
Title
adds support for sr-only to active menu item
adds support for screen readers to active menu item
avatar N6REJ N6REJ - edited - 11 Sep 2019
avatar N6REJ
N6REJ - comment - 11 Sep 2019

@brianteeman would it be applied to the list item or the anchor?

avatar brianteeman
brianteeman - comment - 11 Sep 2019

Exactly as it is written in the page I linked to

avatar N6REJ
N6REJ - comment - 12 Sep 2019

Can't seem to figure out what creates the menu item when the menu type is "single article"
SOLVED

avatar N6REJ N6REJ - change - 12 Sep 2019
The description was changed
avatar N6REJ N6REJ - edited - 12 Sep 2019
avatar N6REJ
N6REJ - comment - 12 Sep 2019

@brianteeman ready for testing ?‍♂

avatar N6REJ N6REJ - change - 12 Sep 2019
The description was changed
avatar N6REJ N6REJ - edited - 12 Sep 2019
avatar brianteeman
brianteeman - comment - 12 Sep 2019

Why are you excluding setting aria-current when its the home?

avatar N6REJ
N6REJ - comment - 12 Sep 2019

what install? I don't see that behavior
image

avatar brianteeman
brianteeman - comment - 12 Sep 2019

sorry - I misread the diff - i think - will test later

avatar N6REJ
N6REJ - comment - 12 Sep 2019

turns out that when the menu item is an alias ( like top bar home in protostar ) although it gets the "active & current" classes it's ID doesn't match the active id value because that is to its referenced menu item. SO, there's another id that references its parent so you have to test against that one too ergo the last commit

avatar SharkyKZ
SharkyKZ - comment - 12 Sep 2019

It is because you changed the formatting. You can see changes without whitespace changes here https://github.com/joomla/joomla-cms/pull/26261/files?w=1.

avatar N6REJ
N6REJ - comment - 12 Sep 2019

It is because you changed the formatting. You can see changes without whitespace changes here https://github.com/joomla/joomla-cms/pull/26261/files?w=1.

whew!! ty @SharkyKZ my chest is literally pounding cause I thought I somehow totally messed things up and was freaking out trying to figure out how the hell I did that!
image
This is what freaked me out.
How did you find the link for w/o formatting?

avatar SharkyKZ
SharkyKZ - comment - 12 Sep 2019

When viewing changed files, click the gear icon and select Hide whitespace changes.

avatar brianteeman
brianteeman - comment - 15 Sep 2019

Pr for joomla 4 admin menu done #26326

avatar joomla-cms-bot joomla-cms-bot - change - 17 Sep 2019
Category Modules Front End Libraries Modules Front End
avatar joomla-cms-bot joomla-cms-bot - change - 17 Sep 2019
Category Modules Front End Libraries Modules Front End
avatar brianteeman brianteeman - test_item - 18 Sep 2019 - Tested unsuccessfully
avatar brianteeman
brianteeman - comment - 18 Sep 2019

I have tested this item ? unsuccessfully on c5b3f23


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

avatar brianteeman
brianteeman - comment - 18 Sep 2019

Adding aria-current is perfectly ok
Removing or changing classes is not. This will potentially break any site that is using those classes for styling


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

avatar SharkyKZ
SharkyKZ - comment - 18 Sep 2019

Removing or changing classes is not.

@brianteeman What are you talking about?

avatar brianteeman brianteeman - test_item - 18 Sep 2019 - Not tested
avatar brianteeman
brianteeman - comment - 18 Sep 2019

I have not tested this item.

Reset my test - the way github displayed the diff it made it look like classes were changed


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

avatar infograf768 infograf768 - alter_testresult - 18 Sep 2019 - brianteeman: Not tested
avatar N6REJ
N6REJ - comment - 2 Oct 2019

made changes suggested by @Quy

avatar Renuka-S Renuka-S - test_item - 19 Oct 2019 - Tested successfully
avatar Renuka-S
Renuka-S - comment - 19 Oct 2019

I have tested this item successfully on b272903


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

avatar Renuka-S Renuka-S - test_item - 19 Oct 2019 - Tested successfully
avatar Renuka-S
Renuka-S - comment - 19 Oct 2019

I have tested this item successfully on b272903


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

avatar jduerscheid jduerscheid - test_item - 19 Oct 2019 - Tested successfully
avatar jduerscheid
jduerscheid - comment - 19 Oct 2019

I have tested this item successfully on b272903

It works


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

avatar alikon alikon - change - 20 Oct 2019
Status Pending Ready to Commit
avatar alikon
alikon - comment - 20 Oct 2019

RTC


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

avatar HLeithner
HLeithner - comment - 20 Oct 2019

There are some things wrong in this PR.

in default_component.php you try to check if the active_id is in aliasoptions, thats not possible because aliasoptions is only used if the type is "alias". So you can remove this.

You use the same if in default_url.php which will is also wrong. In this case $item->id can't be $active_id reason for this is that in this case the type is "url" and url can't be active. Also the second part of this if statement is wrong because you try to access $item->params as array but it's a JRegistry for this you have to access it with the ->get method.

The other thing is the attribute it self, Joomla's menu system is really weak for the current page. it uses anything that has the correct Itemid as current. Which basically doesn't need to be true for example for blog posts in categories. For example if you read a article in a "news" category the menu item is highlighted but it doesn't link to the current article instead it links to the "news" category.

The j4 implementation is more correct using the complete url to set this attribute.

avatar brianteeman
brianteeman - comment - 20 Oct 2019

The other thing is the attribute it self, Joomla's menu system is really weak for the current page. it uses anything that has the correct Itemid as current. Which basically doesn't need to be true for example for blog posts in categories. For example if you read a article in a "news" category the menu item is highlighted but it doesn't link to the current article instead it links to the "news" category.

You are confusing things here. The purpose of this PR is to inform users of assistive technology with information that tells them exactly which menu item is the active one - ie the menu item that was clicked last. Your example seems to be talking about a canonical link which is not the same thing at all.

avatar HLeithner
HLeithner - comment - 20 Oct 2019

Your PR for J4 #26326 adds aria-current="page" only if the complete url is the same. Which would be "the current page". But if you add aria-current="page" to news on a page with the url "/news/5-article" doesn't sound correct to me.

Why should it be different in j4 then in j3? ymmv

avatar brianteeman
brianteeman - comment - 20 Oct 2019

Your PR for J4 #26326 adds aria-current="page" only if the complete url is the same.

No thats not correct. It does what I believe the code here does and adds it to the active menu item

Why should it be different in j4 then in j3? ymmv

I dont believe (I've not checked the code here) it is just that the implementation is different

At the end of the day the objective of this aria attribute is to provide an accessible alternative to adding css to a menu link to indicate it is the currently selected menu link

avatar brianteeman
brianteeman - comment - 20 Oct 2019

NOTE my J4 pr is for the admin - this is for the frontend - where the sub-items that dont have menu links (which is what I guess your example would be) have the main menu hidden. So we're probably both getting a little confused here as we're comparing apples to lemons I'm not even sure if I am convinced that this should be in core

avatar rdeutz rdeutz - change - 24 Nov 2019
Labels Added: ?
avatar HLeithner
HLeithner - comment - 5 Dec 2019

@alikon I can't remove RTC, also I think the implementation as I wrote above isn't correct. Also I'm not sure if this attribute is correct at all in this case.

avatar Quy Quy - change - 5 Dec 2019
Status Ready to Commit Pending
avatar Quy
Quy - comment - 5 Dec 2019

Removed RTC.


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

avatar Quy
Quy - comment - 5 Dec 2019

Removed RTC.


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

avatar N6REJ
N6REJ - comment - 6 Dec 2019

I give up. It's always a fight to do anything.
Someone else can take the heat.

avatar N6REJ N6REJ - close - 6 Dec 2019
avatar N6REJ N6REJ - change - 6 Dec 2019
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2019-12-06 12:29:43
Closed_By N6REJ
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment