Button click requires double click or long-press on mobile - javascript

I'm trying to click a button in a React app, and while it works on desktop, it does not work properly on mobile. I need to long-press or double-click, and play a little bit until the button finally works.
I have replicated my problem in this demo.
If you open the page on a desktop browser and attempt to open the hamburger menu, it should open right away. However, if you open it in mobile, it will not work right away. You will also see the menu jitter a little bit off-screen. Attempting to close the menu by clicking on the overlay has the same problem in mobile.
Why is this not working properly on mobile? How can I get the button to work when I tap it?
I added cursor:pointer to the button after seeing this somewhat similar post, but this doesn't help.
This problem has occurred in the past to me, and I was able to solve it using onMouseDown but it doesn't work this time, I'm guessing because I'm using a component that is imported from a package (react-burger-menu) and can't override its onClick function? I'm not sure what is happening.
EDIT: Solved. See my answer.

Turns out it works if I fix the stacking of elements. I had nested my navbar component inside the MapContainer, but this was making things wonky mobile-side. I moved my component outside the MapContainer, and things worked.
I still don't understand why it went wonky mobile-side and in iOS only, but this problem at least is solvable.
Fixed example is here.
My map token has been removed, so you can use your own to substitute, but it is not necessary to have the map showing to see the problem/solution.

Related

Search icon on mobile site unresponsive and no longer toggles open

The search icon on my mobile website suddenly stopped working recently. It's supposed to toggle open a search bar; however, now when I click it, nothing happens.
When I long press via Chrome on mobile it displays "about:blank#blocked" and on Firefox on hover it displays javascript:void(0).
Not sure what caused it to stop working and it's a bit frustrating.
If anyone has any insights or ideas on how to solve it, that would be super helpful.
My website is www.gentlemanwithin.com
I see your issue:-
Your issue is when you are trying to access custom search form that unable to access because you added an extra search button which is not belongs to that. So you try toggle function to show yellow colored area of your code. After it your issue will solve. Below I have attached your site screenshot image, that you can see it for the reference.

Element distorts when scrolling, and sometimes doesn't scroll

EDIT:
A colleague worked out what was wrong. It was because the aside element had z-index: 2. Although it is fixed now, I'm not sure why that z-index: 2 was causing these issues in the first place. If anybody knows why, I'd like to know.
I'm having a rather odd issue on a website i'm working on. When on the architecture section, I click on one of the blocks to open the project, and it works. Almost. When one of the projects is open, the aside on the left does not scroll correctly. It distorts and splits up. Here is a screenshot:
But the odd thing is, the interiors section, which uses the same code, works fine. I have just recently finished re-coding the news section with a new design and more features, so it could be something to do with that. But, so far, I have found no connection with other sections on the page.
There are other errors on that specific page too. The Close button and next button hover events don't seem to be firing. However, if I open Dev tools and set the width of the close button to 29px, the hover event works, and the cross goes orange.
You can access the site at http://dev.guyhollaway.co.uk/
If anybody has any ideas, I'd be very thankful.
This happens on Google Chrome on both Windows and OS X.
Thanks in advance.

angularjs ngRepeat Sometimes I can't scroll down

I have an angular site, everything's pretty async. Dom elements render after page load and things just pop in. Sometimes, around 10%, of times when I load the page after it finishes loading scrolling down is impossible. On Chrome OSX no scroll bar pops up when I use the mousewheel or the spacebar. It just appears stuck. Note that the page is not frozen, interacting with most elements work just fine, just the scrolling is broken. Only the up down keys work. Once I click on the up down keys it becomes fine to scroll with mousewheel and spacebar.
What causes this problem and how do I fix it? Thanks.
Please check other browsers!
I can only confirm this issue in Chrome...
see google help forum: Anyone having trouble with Google Chrome unable to scroll, focus, etc?

Strange behaviour of navigation bar on mobile screens

I'm using a version of Bootstrap CSS for this site and a live example would demonstrate this the best.
http://autorotation.org/jabilake/index.php?page=residential
Basically, on mobile screens, the parent nav element (li), "Projects", doesn't seem to work at all when you click on the actual word. However, click just right of the letter "s" and it works fine (i.e. goes to the page).
I tried a few CSS and JavaScript tricks, but no luck.
Any idea?
Thanks.
it only doesn't work when on the projects page or it's submenu pages. And its just the touch event not working. click is fine at that screen size, at least in my browser.
I believe the issue is with the custom data attributes. Only on those pages does your menu contain data-toggle= and data-target= for the Projects li. If css is controlling the dropdown, you don't need this and I think the problem will go away. If javascript is controlling the dropdown perhaps it is using these values. try just removing the attributes and see what happens

Sencha Touch: Panel.hide()/show() works only after resize

Here's a demo app: demo Sencha Touch app. The button in the bottom-left corner should show/hide the menu panel on top of the "Location info goes here" bar, however, it works in a strange way.
Here's how (IMO) it should work:
I click a button
A panel appears
Here's how it works now:
I click a button
Nothing happens
I resize a window or press F11 (which is resizing too, anyway)
A panel appears
So, can somebody explain why is this happening and how can I solve my issue? Thx.
I've found a way to get around this. Here it is:
app.viewport.dockedItems.items[0].rendered = false;
app.viewport.doComponentLayout();
So, problem solved.
I don't know exactly what your code is doing but you need to do a doLayout or doComponentLayout call on the Panel to refresh the items when adding or removing components.
The resize event which happens when changing the browser window performs that call which is probably the reason why you are seeing that behavior.
I've posted an answer here that might be of use to fix this issue.
http://www.sencha.com/forum/showthread.php?141705-Show-Hide-Toolbar-docked-panel-briefly-renders-incorrectly&p=762261&viewfull=1#post762261

Categories