Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#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
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
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
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
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
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
Re: Open the submenu on hover, not on click
phiw13 wrote #298928:
that would set the
.dropdown-menu
todisplay: 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
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
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
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
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