Drag a link in site admin block and then move mouse over the links makes the icons move in Chrome

Drag a link in site admin block and then move mouse over the links makes the icons move in Chrome

by Gareth J Barnard -
Number of replies: 20
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Moodlers,

This MDL-50554 is a weird one if you've ever noticed that the icons start to move in Chrome with Clean, Campus, More...... in fact any Bootstrapbase theme.  I don't think Essential or Shoehorn are affected so could be BS2.3.2 based themes only.  It has just been released, so please update your Moodle 2.8+ to get the benefit.

To show your appreciation of my work, please mark this post as useful.  It lets me know that its worth it.  And if you get a chance, thank everybody involved too by replying with a short note.

Cheers,

Gareth

Average of ratings: Useful (4)
In reply to Gareth J Barnard

Re: Drag a link in site admin block and then move mouse over the links makes the icons move in Chrome

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Thanks to:

Davo Smith for reporting this runaway icon bug first in MDL-50193.

Gareth for fixing it.

LazyDaisy for Peer Reviewing it.

Simey Lameze for testing it.

Andrew Nicols for Integrating it into Moodle!

Don Poltawski for authoring this weeks updated versions of Moodle...

Mary (aka LazyDaisy)

Average of ratings: Useful (2)
In reply to Mary Evans

Re: Drag a link in site admin block and then move mouse over the links makes the icons move in Chrome

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

And thank you to everyone above!

In reply to Mary Evans

Re: Drag a link in site admin block and then move mouse over the links makes the icons move in Chrome

by Nadav Kavalerchik -
Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators

Such a beautiful easter egg! what a shame it was removed out of the code sad

Well... I will try and hide it somewhere else, nobody can find smile

In reply to Nadav Kavalerchik

Re: Drag a link in site admin block and then move mouse over the links makes the icons move in Chrome

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

LOL egg

In reply to Nadav Kavalerchik

Re: Drag a link in site admin block and then move mouse over the links makes the icons move in Chrome

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
In reply to Gareth J Barnard

Re: Drag a link in site admin block and then move mouse over the links makes the icons move in Chrome

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

And does M3.0 need to support IE6? -> https://github.com/moodle/moodle/blob/master/blocks/settings/styles.css#L23-L24 - time for a clear up!

In reply to Gareth J Barnard

Re: Drag a link in site admin block and then move mouse over the links makes the icons move in Chrome

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

It has been brought to my attention that MDL-50554 might have caused a regression in terms of accessibility.  This is down to 'tab focus' being I believe the outline that is placed on an element by CSS when the tab key is used and an element has focus.

The story of this being:

a:focus {
  .tab-focus();
}

of: https://github.com/moodle/moodle/blob/master/theme/bootstrapbase/less/bootstrap/reset.less#L49-L52 implemented as:

.tab-focus() {
  // Default
  outline: thin dotted #333;
  // Webkit
  outline: 5px auto -webkit-focus-ring-color;
  outline-offset: -2px;
}

of: https://github.com/moodle/moodle/blob/master/theme/bootstrapbase/less/bootstrap/mixins.less#L27-L35.

Therefore my current line of thinking being that the issue is caused by the negative 'top' on the img implemented as:

.block_settings .block_tree li.item_with_icon > p img {vertical-align:middle;position:absolute;left:0;top:-1px; width: 16px; height: 16px;}

of: https://github.com/moodle/moodle/blob/master/blocks/settings/styles.css#L12.  So, I think what is happening is that the outline applies and conflicts in Chrome with the calculation of the img position being outside of its 'box'.  This then translates into movement as the browser repaints on a mouse move.  The negative 'top' is there to make the icon 'look good' against the set size of text etc.  The solution could be to not have the 'outline' on the img only or somehow reduce the size of the icon so that 'top' could be '0'.  But the either might not work and the latter will have 'complaints' about the look and feel changing - arrrggghh!

Thoughts / solutions please.

Kind regards,

Gareth


In reply to Gareth J Barnard

Re: Drag a link in site admin block and then move mouse over the links makes the icons move in Chrome

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Gareth,

I was looking at the post prior to this last night and was wondering if the a:focus fix you applied in MDL-50554 might have been better targeted at the block icons only using a Webkit prefix solely for Chrome and Safari as these two browsers tend to have the same bugs, rather than the global a:focus { outline: none; } that you applied?

Just a thought?

Mary

In reply to Mary Evans

Re: Drag a link in site admin block and then move mouse over the links makes the icons move in Chrome

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Thanks Mary, just trying a few ideas out now and will try yours to see if it fixes the issue.  I've commented on the tracker as a note.  If there is a fix then will have to do a new issue and go through the whole laborious process again.

In reply to Gareth J Barnard

Re: Drag a link in site admin block and then move mouse over the links makes the icons move in Chrome

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Just found this which points to a JS error...I think!

https://github.com/Automattic/_s/issues/543

You are right about the -1px conflicting.

Is there a relative positioning in the icon CSS in Bootstrapbase?

I need to go look at this.

M

In reply to Mary Evans

Re: Drag a link in site admin block and then move mouse over the links makes the icons move in Chrome

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Mary,

Oh no, the CSS comes directly from the block with absolute positioning:

.block_settings .block_tree li.item_with_icon > p img {vertical-align:middle;position:absolute;left:0;top:-1px; width: 16px; height: 16px;}

Everything I've tried so far has failed to fix it, including 'top: 0', 'height: 15px', 'outline-offset: 0px'.... and targeting only the 'img'

In reply to Gareth J Barnard

Re: Drag a link in site admin block and then move mouse over the links makes the icons move in Chrome

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Ok, given the Chrome issue you found Mary: https://github.com/Automattic/_s/issues/543 - there is grounds for the argument that the fix needs to be removed for accessibility reasons and people will just have to live with it until Chrome itself fixes the problem.

But the item in Clean is still underlined so falls to option 2 here: http://a11yproject.com/posts/never-remove-css-outlines/.

In reply to Gareth J Barnard

Re: Drag a link in site admin block and then move mouse over the links makes the icons move in Chrome

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Ok, as a compromise, what about:

a:focus {
    outline: none;
    border: thin dotted #333;
}

as there is no '-webkit-outline'?

When tabbing there is still some movement of the icon, but not with the mouse and only once per tab.

Raised MDL-50659 for comments etc.

In reply to Gareth J Barnard

Re: Drag a link in site admin block and then move mouse over the links makes the icons move in Chrome

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Ok, nothing I do apart from 'outline: none' on the parent 'a' with 'focus' fixes the issue!

In reply to Gareth J Barnard

Re: Drag a link in site admin block and then move mouse over the links makes the icons move in Chrome

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Now discovered that the 'border' fix causes odd behaviour with the Grid format box when clicked on!  Arrrggghht!

And border causes odd jumping of item when clicked on, so not a solution.

In reply to Gareth J Barnard

Re: Drag a link in site admin block and then move mouse over the links makes the icons move in Chrome

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Make top:  0;

and change positions: absolute to position: relative; 

for the icons and the bug goes away.

In reply to Mary Evans

Re: Drag a link in site admin block and then move mouse over the links makes the icons move in Chrome

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Mary,

So... is 'top: 0' and relative position a solution in Moodle for: MDL-50193?

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Drag a link in site admin block and then move mouse over the links makes the icons move in Chrome

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Have you tried it?

I remember it working in the browser, but cannot remember if it worked as a CSS fix. I was trying so many things out at the time and got over tired And gave up.

In reply to Mary Evans

Re: Drag a link in site admin block and then move mouse over the links makes the icons move in Chrome

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

I was just about to, but in Chrome '44.0.2403.125 m' it appears that the issue has gone away despite https://github.com/Automattic/_s/issues/543 still being open, humm!  Will update the tracker.

In reply to Gareth J Barnard

Re: Drag a link in site admin block and then move mouse over the links makes the icons move in Chrome

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Oh goody!