iOS Toolbar on TextField doesn't hide smoothly when calling blur - ios

I have a TextField set to display a number keypad. By default, this doesn't seem to come with a way for the user to indicate he's finished entering data and then hide it so I added a KeyboardToolbar in the XML which has a DONE button.
When I click the textfield, the number keypad displays the toolbar with the DONE button. When I click "Done", the keypad starts to scroll off the window, but the toolbar doesn't move. When the keypad is fully out of the view, the toolbar then jumps to the bottom of the window and then scrolls off the page too. This causes a noticeable flash for the user.
Any idea how to stop this flash effect from happening? I tried setting opacity 0 on the toolbar when clicked but it doesn't have any effect.
(Expected result is that the toolbar scrolls down with the keypad)
Here's a slowed down GIF to illustrate:
XML:
<TextField id="txt_contactNumber" class="txt_inputshort">
<KeyboardToolbar>
<Toolbar id="numberToolbar" bottom="0">
<Items>
<Button id="flexSpace" systemButton="Ti.UI.iPhone.SystemButton.FLEXIBLE_SPACE" />
<Button id="cancelContact" systemButton="Ti.UI.iPhone.SystemButton.DONE" />
</Items>
</Toolbar>
</KeyboardToolbar>
</TextField>
JS:
$.cancelContact.addEventListener('click', function(){
$.txt_contactNumber.blur();
});
TSS:
"#txt_contactNumber": {
keyboardType: Ti.UI.KEYBOARD_NUMBER_PAD,
}

Related

Keyboard aware scroll view scrolling to unfocused textinput when keyboard dismissed React native

i'm using react-native-keyboard-aware-scroll-view for form, it is working but getting one issue..
scroll down to the last input and entered the text
scroll up to the top of the screen and clicked on dropdown
Actual Behavior
keyboard dismissed and it is scrolling to last unfocused text input box
it happens only when clicked on out of the text input box or any input like dropdown
or check button
Expected Behavior
need to dissmiss keyboard and not scroll to last unfocused text input
This is my code
<KeyboardAwareScrollView
extraScrollHeight={120}
contentContainerStyle={{flexGrow:1}}
keyboardShouldPersistTaps={'handled'}
keyboardOpeningTime={0}
bounces={false}
bouncesZoom={false}
enableResetScrollToCoords={true}
alwaysBounceVertical={false}
contentInsetAdjustmentBehavior="automatic"
>
packages
react-native:0.64
react-native-keyboard-aware-scroll-view: "^0.9.4"

React Native TextInput blur consumes TouchableHighlight press event

I have a <TextInput> that I'd like to submit when I tap the red Post button, a <TouchableHighlight>. When the TextInput is focused, I finish typing and I tap on the Post button, the keyboard closes but the button doesn't register the tap.
I tried using the TextInput onBlur event, but It doesn't give me the coordinates of the touch point, so I don't know if the touch point is actually over the button or not.
You need to add the property keyboardShouldPersistTaps={true} to your ScrollView.
Here is what the docs say :
keyboardShouldPersistTaps bool:
When false, tapping outside of the focused text input when the
keyboard is up dismisses the keyboard. When true, the scroll view will
not catch taps, and the keyboard will not dismiss automatically. The
default value is false.
#frank, I imagine you found a workable solution, but in addition to the 'keyboardShouldPersistTaps', if you wrap your view in a TouchableWithoutFeedback element with an onPress that calls dismissKeyboard it should fix the issue.
<ScrollView keyboardShouldPersistTaps={true} ref='scrollView'>
<TouchableWithoutFeedback onPress={dismissKeyboard}>
<View>
-View Content-
</View>
</TouchableWithoutFeedback>
</ScrollView>

Anchor Scroll not working

I have a button at the top of the page:(Button-A)
<div class="menu-btn-right loginandadd" >
<a href="#" id="A" class="some_class" title="something"</a>
</div>
Then I have another button half way through the page (Button-A is not visible anymore):(Button-B)
<a id="B"><img class="start1addproductbutton" src="#" alt="empty" width="1" height="1" />
</a>
Also, I have the following script:
<script>//
<![CDATA[ jQuery("#B").click(function(){
jQuery("#A").trigger('click');
return false; });
// ]]></script>
In this current setting, when the Button-B is clicked, Button-A is clicked automatically.However since the Button-B is located in the middle and Button-A is not visible, when the Button-B is clicked, users do not know that Button-A is clicked unless they manually scroll to the top.
I tried to add an anchor so that when the button-B is clicked, the page is scrolled to the top and users can see that Button-A is automatically clicked.
However in my test due to the javascript, the anchor tag is not working.
What can I do so that when Button-B is clicked, the page is scrolled to the top and Button-A is still automatically clicked?
Thanks
Try this code which scrolls to element A manually, instead of triggering the click event of that element.
<script>
jQuery("#B").click(function(){
jQuery('html, body').animate({
scrollTop: jQuery("#A").offset().top
}, 2000);
return false;
});
</script>

How to show the large image when click on image in wp7?

In a page i am displaying image,desc,etc fileds.whenever click on that small image need to display large size image and close icon also and need to show the blur of the background screen(for no user interaction in background fileds).whenever click on close icon need to show actual data.
How to achieve this?
One way is to have this on your page:
<Grid Name="datagrid">
// your small image and other fields
</Grid>
<Grid Name="imagegrid" Visibility="Collapsed">
// larger image and a button to "close"
</Grid>
On TAP event of the SMALL picture, change the datagrid visibility to collapsed and imagegrid visibility to visible.
On click event of the close button in imagegrid, change datagrid visibility to visible and imagegrid visibility to collapsed.
The second way to do this is to use another page with just a large picture and a close button. When the user taps on the small picture, navigate to that second page, and when the user taps close or back button, navigate back to the first page with small picture and all the fields.

How can I place a Firefox toolbar button close to the address bar

I am developing a Firefox addon with a toolbar button. I would like this button to appear close to the browser's address bar and in the same line or row, either at its left or at its right. For instance, like the page saver addon from Pearl Crescent.
But my code just manages to create an empty new row and places the toolbar button in it. A terrible waste of vertical space.
I am using the following overlay in my xul file:
<overlay id="browseye-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<toolbox id="navigator-toolbox">
<toolbar id="my-toolbar"
class="chromeclass-toolbar"
toolbarname="my Toolbar"
hidden="false"
mode="full"
defaultset="my-toolbar-button"
persist="hidden collapsed">
<toolbarbutton id="my-toolbar-button"
tooltiptext="my Toolbar"
orient="horizontal"
mousethrough="never"
oncommand="my.onToolbarButtonCommand()">
</toolbarbutton>
</toolbar>
</toolbox>
</overlay>
Could anybody please help me?
You need to add your button to the toolbarpalette tag without adding a new toolbar, see code example in https://developer.mozilla.org/en/XUL_School/Adding_Toolbars_and_Toolbar_Buttons#Adding_a_new_toolbar. Then the user will be able to position your button anywhere using "Customize toolbar" dialog.

Resources