Menu icon Foundation

My Posts


My Comments

Alexandre Neves commented on Alexandre Neves's post about 4 years

I lost too much time with this so I actually developed my own component for flyouts and stopped using every Foundation component related to the topbar.
I'll be using it for all the dropdowns in the near future.

Thanks for you help :)

Alexandre Neves commented on Alexandre Neves's post about 4 years

You can check it here @ http://playground.pulhas.com.
I'm using 5.5.2 and tried the 5.5.0 and 5.4.0, same thing!

Alexandre Neves commented on Alexandre Neves's post about 4 years

**EDIT you can check this new example playground.pulhas.com

Hi James,

Thanks! I also had a similar issue while inspecting using the xcode simulator, things that weren't working normally would start working after inspecting.

The way I see it this is an event related problem, the body click event doesn't get triggered in mobile which is normal. And this event is responsible for closing the dropdown. It gets triggered tough, when you click on a "a" tag the dropdown does close.

What I don't get, is why it works on their examples...

The event:

S('body').off('.topbar').on('click.fndtn.topbar', function (e) {
  var parent = S(e.target).closest('li').closest('li.hover');
  if (parent.length > 0) {
    return;
  }

  S('[' + self.attr_name() + '] li.hover').removeClass('hover');
});

This event doesn't get triggered while on mobile.

Alexandre Neves commented on Alexandre Neves's post about 4 years

Yes, very odd! I can't figure out the reason, it's supposedly the same code, I copied it from the docs to try and figure out if I had made some kind of mistake in my project, but nonetheless it behaves differently.

I'm hoping someone has the answer to this behaviour.

Posts Followed

No Content

Following

    No Content

Followers

My Posts


My Comments

You commented on Alexandre Neves's post about 4 years

I lost too much time with this so I actually developed my own component for flyouts and stopped using every Foundation component related to the topbar.
I'll be using it for all the dropdowns in the near future.

Thanks for you help :)

You commented on Alexandre Neves's post about 4 years

You can check it here @ http://playground.pulhas.com.
I'm using 5.5.2 and tried the 5.5.0 and 5.4.0, same thing!

You commented on Alexandre Neves's post about 4 years

**EDIT you can check this new example playground.pulhas.com

Hi James,

Thanks! I also had a similar issue while inspecting using the xcode simulator, things that weren't working normally would start working after inspecting.

The way I see it this is an event related problem, the body click event doesn't get triggered in mobile which is normal. And this event is responsible for closing the dropdown. It gets triggered tough, when you click on a "a" tag the dropdown does close.

What I don't get, is why it works on their examples...

The event:

S('body').off('.topbar').on('click.fndtn.topbar', function (e) {
  var parent = S(e.target).closest('li').closest('li.hover');
  if (parent.length > 0) {
    return;
  }

  S('[' + self.attr_name() + '] li.hover').removeClass('hover');
});

This event doesn't get triggered while on mobile.

You commented on Alexandre Neves's post about 4 years

Yes, very odd! I can't figure out the reason, it's supposedly the same code, I copied it from the docs to try and figure out if I had made some kind of mistake in my project, but nonetheless it behaves differently.

I'm hoping someone has the answer to this behaviour.

Posts Followed

No Content

Following

  • No Content

Followers

  • No Content