onClick Action in Tabbar is not calling in Titanium - ios

Team,
I am working on a project which is on Titanium, I am facing one small issues which i cannot find the solution, The issue is
In Index.xml file i am writing code for Tabbar, Writing the click action the tag but in iOS that method is not calling, Where as in Android it is working fine, Dont know whats wrong, Below is the code i wrote.
<Tab id="tab4" title="Coverage" icon="/images/Coverage_tab_n.png" onClick="displayCoverage" class="bcPurple_iOS">
<Window id="win4" title="Coverage" top="20" bottom="20" class="bcPurple_iOS">
</Window>
</Tab>
The onClick action code i am writing in the index.js file which is deault,Am i doing any wrong.

This is a feature request in Titanium TIMOB-6499 It was requested to be added in Android and was but hasn't been added in iOS yet.
Work around could be to use onFocus which works but might not be exactly what you want as it runs when the tabgroup opens. To avoid that, you could set a variable to stop it running on the first load I suppose.
If you're into compiling from source, there is a quick fix from someone in comment thread in the link above which may or may not work.
The feature request has been open since Dec 2011 and is marked as low priority.

Related

(click) event is not working only on IOS devices - angular 10 app

I noticed that my buttons are not working on the IOS devices, it seems that the click event is not called. Everything is working perfectly on the windows, android, Linux. Since I don't have access to any mac I was trying to debug it on the browserStack, I am getting this error every time I am trying to click the button:
ERROR TypeError: undefined is not an object (evaluating 't.path[4]')
I might be completely wrong, but I think that it might be related with the SVG's rect that is inside of the button (I am using it as a progress bar), on the rect load event I am accessing it to find its length. Maby it is called "too early" so it cannot access the rect correctly. Previously I was using the ngAfterViewInit with the setTimeout inside to manage the same effect.
<rect
#rect
width="96"
height="96"
rx="8"
fill="none"
stroke-width="4"
[ngStyle]="{
'stroke-dasharray': strokeDasharray,
'stroke-dashoffset': strokeDashoffset
}"
(load)="getRectLength()"
/>
getRectLength() {
this.length = this.rect.nativeElement.getTotalLength();
this.strokeDasharray = this.length;
}
Code:
https://github.com/mateuszkornecki/chess-clock/tree/master/src
Live demo:
https://mateuszkornecki.github.io/chess-clock/settings
Steps to reproduce:
Simply click on one of the big buttons with the counter, after a click it should start counting.
I tested it on several IOS devices, it was not working on everyone regardless of the IOS version. That's my first project made with Angular so there is a chance that I've made a simple mistake. Any help will be appreciated!
I have found the source of the problem. I was trying to use the event.path array on the click event. It looks that it is not available on the Safari. I fixed the problem by using the event.composedPath instead of the event.path
References:
https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath

React Native events do not work

I have a trivial react component that only shows a button:
<Button onPress={() => console.log("test")} title="Button"/>
When I put this button into a project I created with react-native init, it works as expected.
However, I have an existing project into which I integrated React Native (0.51.0) manually (because it doesn't use cocoa pods; I followed this guide: https://medium.com/#joshyhargreaves/adding-react-native-to-existing-ios-project-without-cocoapods-6f1ee9106009).
The project seems to work fine: the UI loads, the button gives visual feedback when I tap it. But the buttons onPress event is not fired, so it does not log anything.
There are no errors or warnings (except Class RCTCxxModule was not exported, but it seems to be safe to ignore this).
I'm now out of ideas of what I could try or how I could debug this issue short of diving into Reacts touch handling code. Here's what I tried:
Made sure to only have one RCTRootView, and that it is created in the main thread.
Checked for any suspicious things happening in the remote debugger; everything looks normal (no exceptions thrown or warnings logged).
Tested a few other components that should fire events; for example, TouchableOpacity does not work either.
Logging something after a timeout does work, so it doesn't seem like anything is deallocated prematurely
Checking for errors reported by the metro bundler: it doesn't print anything
Any ideas on what I need to do to get my button to print "test" when I tap it?
I think you have not Debug JS Remotely option enabled. If you don't you have to open React Native Debug Menu Pressing (command / control) + D or shake your device if you are debugging with real device. Then just press Debug JS Remotely and it should appear in the Google Chrome. Then inspect and open the console. There it is!
This mite caused by date diff between the host (your computer) and the client (the mobile device)
You can check this by running adb shell "date" && date
to see if there is a diff.
If there is one go to your mobile device and toggle automatic date & time off and back on.
Then test time diff again as mentioned, if there is no more diff, tap events should work in debug mode
More details in the original git issue answer by - Alex Ciarlillo

Why does the angular-material `Getting Started` example not actually work?

Is it just me, or is the angular-material "Getting Started" example broken?
On that page (link above), there's an inline codepen to show using angular-material. But the demo doesn't work! (In particular, I don't see a button to collapse the sidebar.)
Since I used this example in my started project, I spent quite some time troubleshooting it -- to no avail. Then, I realized the example itself it may be broken. And sure 'nuff, it is!
Does anyone know what the actual bug is, so I can work around it on my test app? It must have worked at some time; but I can't figure out why it's broken now.
Thanks!
That particular pen is working fine for me but I have noticed a few are not working, and it's due to the angular-material.js link being incorrect in the dependencies (under the pen's settings) the link provided redirects to the CSS.
This is intentional - the sidebar only becomes collapsable on smaller screens and is open on larger screens. Shrinking your browser window will show the collapse button.
That being said, the Getting Started page is definitely in need of an update. It is a good guide for a basic page structure, but the individual demo pages will be a lot better if you're looking to try out some of the components. (Every demo has a CodePen link to open an editable version.)

Automatic Typing Textarea/input/form in JavaScript

I've been searching for a way to make a textarea type inside of itself. Unfortunately, even with some google searching, I still don't have a clue? Do you guys know where to start with this?
http://lmgtfy |dot| com is an example, but I'm not sure if they use some other technique...
The lmgtfy people are simply using javascript to change the value of the input. Here is a simple jsfiddle showing the same thing:
http://jsfiddle.net/Caut6/1/
LMGTFY uses javascript. If you visit the site using chrome or some other browser with a debugger, you should be able to pause javascript execution and check out how they do it, then roll or copy your own version.
In Chrome, the pause button is under the Scripts area. Their bundle.js files appears to host the JS you are looking for, it is around 1000 lines of code, but you should be able to see the few functions you need to borrow their implementation.
Hope this helps.

Phonegap application would not work in iOS

I have a very interesting problem. I have a phone-gap application that I am building. It works fine when we run it in the android environment, or even when we open index.html in firefox. But when I try to run this on an iPad simulator in Xcode, it fails.
The application installs fine and displays the start up page correctly. The next thing my application requires is to open a job attached in the email. But as soon as we do that, thats when it starts failing. It does not display the body text. The header and the footer are displayed fine.
To me this does not look like any javascript error because I am able to run this code on other platforms. I think its got to do with some css I am using which might not be compatible with iOS. Also, I have this other problem that my code will not run on any version except phone gap-1.3.0. I am not sure if that has anything to do with this too.
Anyways, I would like to know your thoughts on this.
ok the offending code was found to be the following:
$.mobile.touchOverflowEnabled = true;
I just stumbled across this and I am not sure why its breaking my app. Anybody got any ideas.
After commenting this code out, my app worked fine.

Resources