Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-05-02 14:33:02

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Open the submenu on hover, not on click

Since the last 4.6 releases, we need 2 clicks to open txp windows. Before, one click : hover on the main menu item then a click on the vertical menu.

Is it possible to avoid 2 clicks ?

Thanks !

Offline

#2 2016-05-02 21:04:58

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: Open the submenu on hover, not on click

jpdupont wrote #298918:

Since the last 4.6 releases, we need 2 clicks to open txp windows.

Yes, because 4.6 is more mobile-aware and mobiles don’t have a hover state.

Is it possible to avoid 2 clicks ?

Yes, if we sacrifice mobile support or come up with some clever way round it.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#3 2016-05-03 04:54:32

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: Open the submenu on hover, not on click

Why can’t we have both hover (for devices with pointers) and click (for devices with or without pointers)?

Offline

#4 2016-05-03 08:19:35

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: Open the submenu on hover, not on click

wet wrote #298924:

Why can’t we have both hover (for devices with pointers) and click (for devices with or without pointers)?

*shrug* Guess that’d work. Never tried doing both as I figured it would try to fire the event twice or something. But I suppose one JS hook would override the other in the bubble order so it’s probably fine. Maybe Phil knows more.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#5 2016-05-03 09:14:38

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: Open the submenu on hover, not on click

.dropdown:hover .dropdown-menu{display:initial} works fine for me, though not tested on mobiles.

Offline

#6 2016-05-03 10:13:49

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: Open the submenu on hover, not on click

There is no reason why it would not be possible. Hover effects are just a bit of CSS. What won’t work is the aria machinery for the benefit of screen readers – someone who uses a combination of screen reader + mouse to navigate the page won’t get the spoken notification (aria-expanded).

@media (min-width:47em) and (pointer:fine) {
  .dropdown:hover .dropdown-menu { display: block; }
}

would work fine on most targeted browsers (and hide the whole :hover thingie from devices that don’t support hover – think iPad).

Personally I like it like it is, I have a deep deep aversion to those hovering things that pop open whenever the mouse pointer happens to pass over it.

@etc

etc wrote #298927:

{display:initial}

that would set the .dropdown-menu to display: inline which could have unintended consequences.

PS – hmm, according to Caniuse, the (pointer:fine) media feature is not supported by Firefox. Sigh.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#7 2016-05-03 11:12:49

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: Open the submenu on hover, not on click

phiw13 wrote #298928:

that would set the .dropdown-menu to display: inline which could have unintended consequences.

It is set to block (at least in Firefox), as expected for <ul />. And setting a <span /> to block could have unintended consequences too. Edit: or should it be unset? Well, I leave it with designers. :)

PS – hmm, according to Caniuse, the (pointer:fine) media feature is not supported by Firefox. Sigh.

Even if it were, we shouldn’t rely on draft features.

Last edited by etc (2016-05-03 11:44:25)

Offline

#8 2016-05-03 12:47:42

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: Open the submenu on hover, not on click

In TXP 4.5 admin, hover works for desktop browsers and click (i.e. tap) is required on mobile.

Stupid question: why does that behaviour have to change in 4.6?

Offline

#9 2016-05-03 13:24:05

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: Open the submenu on hover, not on click

The current menu process into 4.6dev isn’t definitely a problem for me ;)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#10 2016-05-03 13:59:17

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: Open the submenu on hover, not on click

etc wrote #298929:

It is set to block (at least in Firefox), as expected for <ul />.

That would be bug in Firefox then. In Firefox Developer editor, its computed value is correctly inline. It may look like block due to the particularities of the child elements though. By unintended consequence I mean: it could have unexpected side effects on the functionality of the menu, as it exist.
And note, that is not supported by IE 11, still a supported browser.

Last edited by phiw13 (2016-05-03 14:00:31)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#11 2016-05-03 14:59:20

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: Open the submenu on hover, not on click

FF 46 inspector says block, with the inline matching rule, but you are doubly right. The specs say inline is by property (not by element) rule, and it’s not yet completely supported. I stay corrected. :)

Re OP, +1 for hover, but can live without it.

Offline

#12 2016-05-04 09:09:38

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: Open the submenu on hover, not on click

gomedia wrote #298932:

In TXP 4.5 admin, hover works for desktop browsers and click (i.e. tap) is required on mobile.

Stupid question: why does that behaviour have to change in 4.6?

+1

Offline

Board footer

Powered by FluxBB