when i click the have password visible functional eye icon in the textInput component, keyboard is gone - keyboard

when i click the have password visible functional eye icon in the textInput component, keyboard is gone. I want to keep the keyboard visible and use this function, but I don't know what to do.
<TextInput
name="password"
label="Enter Your Password"
mode="outlined"
style={styles.textInput}
autoCapitalize={'none'}
onChangeText={text => setPassword(text)}
secureTextEntry={passwordVisibility}
value={password}
right={<TextInput.Icon icon={passwordVisibility ? "eye" : "eye-off"}
onPressIn={() => {
passwordVisibility ? setPasswordVisibility(false) : setPasswordVisibility(true)
}} />}
returnKeyType='next'
/>
enter image description here

Related

How to clear selected options from react select?

I have implemented react select in my SPFx react project.
Below is the reference link for the react select control,
https://react-select.com/home
Below is the code snippet of the react select control.
<Select options={
(searchValue === null || searchValue) ?
filteredData?.map((item) => {
return {
value: item?.EncodedAbsUrl,
label: <a href={item?.EncodedAbsUrl} data-interception="off" target="_blank" rel="noopener noreferrer" className='link-name '>
{item?.FileLeafRef.split('.')[0]}
</a>
};
}) : []}
isMulti
className="ddl-search"
isClearable={true}
isSearchable={true}
placeholder={<><i className="fa fa-search"></i><span className='padding-left'>Search Forms & Templates</span></>}
onInputChange={(e) => filterDocuments(e)}
components={{ NoOptionsMessage }}
menuIsOpen={isOpenMenu}
onBlur={() => setIsOpenMenu(false)}
escapeClearsValue={true}
backspaceRemovesValue={true}
ref={ref}
openMenuOnFocus
/>
I need to remove all selected options programmatically without pressing any key or clicking a button.
Below is the screenshot for the same for more clarification.
Can anyone help me with the same?
Thanks

How to use DataAnnotations Display attribute for multiple radio button lables

It's handy to use a Display attribute for model properties in MVC:
Model:
[Display(Name="Your Name:")]
public string Name { get; set; }
View:
#Html.LabelFor(m => m.Name)
#Html.EditorFor(m => m.Name)
But ... is it possible to use the Display attribute for naming the individual choices for radio buttons? The following is what I use now, but the 'Label for...' tag is a little inconsistent with the rest of the view. Anyone?
<div class="radio-inline">
#Html.RadioButtonFor(m => m.OpenToPublic, true, new { id = "isOpenToPublic" })
<label for="isOpenToPublic">Open to the Public</label>
</div>
<div class="radio-inline">
#Html.RadioButtonFor(m => m.OpenToPublic, false, new { id = "isInviteesOnly" })
<label for="isInviteesOnly">Invitees Only</label>
</div>
I like the code above, since using the Label tag results in being able to click on the label text to select the radio button, and the styling of the text is correct. I just wonder if there's a way to do this with data annotations on the model's property for the radio button.
Thanks,
Brian

How to click data-bind input on login.microsoftonline.com for nightwatchjs

I have tried to click to NO or YES on login.microsoftonline.com on the Stay signed in? dialog and I cant get pass this page, checking the code this page has
There is no frames on the page :(
<input value="Yes" aria-describedby="KmsiDescription" id="idSIButton9" class="btn btn-block btn-primary" data-bind="
attr: {
'id': primaryButtonId || 'idSIButton9',
'aria-describedby': primaryButtonDescribedBy },
value: primaryButtonText() || str['CT_PWD_STR_SignIn_Button_Next'],
hasFocus: focusOnPrimaryButton,
click: primaryButton_onClick,
enable: isPrimaryButtonEnabled,
visible: isPrimaryButtonVisible" type="submit">
<input value="No" id="idBtn_Back" class="btn btn-block" data-bind="
attr: {
'id': secondaryButtonId || 'idBtn_Back',
'aria-describedby': secondaryButtonDescribedBy },
value: secondaryButtonText() || str['CT_HRD_STR_Splitter_Back'],
hasFocus: focusOnSecondaryButton,
click: secondaryButton_onClick,
enable: isSecondaryButtonEnabled,
visible: isSecondaryButtonVisible" type="button">
Please anyone could help me?
Is this page in the same frame?
If not then you may have to switch to the right frame and then select the button.
In order to select the button you may use SelectBy ID etc.
Or else you may use JavaScriptexecutor to execute the Javascript event to select the button.
https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/JavascriptExecutor.html
It looks like the Yes button has the id idSIButton9. You should be able to just use that.
browser.click('#idSIButton9');
Or even this should work
browser.click('input[value="Yes"]');

Cannot find a way to tap() this element (wd,nodejs)

I have a DOM like this:
<form id="frmResendPassword" role="form" method="post">
<div class="form-group">...</div>
<span class="pull-right">
<button type="submit" class="btn btn-sm btn-default">
Resend Password</button>
</span>
</form>
I want to tap the "Resend Password" button.
I have tried many different selectors such as:
elementByClassName("btn-default")
elementById("frmResendPassword")
elementByName("Resend Password")
elementByCss(thecsspath)
ect.... none of them perform the tap()...
however they do not throw a element not found error....
so im confused. can some one please help
update:
Here is the basic automation code... its very basic
it("should send text to phone", function(){
sleep.sleep(5)
return browser
.elementByName("mobileNo")
.sendKeys(usrnme)
.elementByCss("#frmResendPassword button[type=submit]")
.tap()
})
It types the mobile number in fine, however it seems to just ignore pressing the button.
My guess is that the selector is the problem. Try this:
elementByCss("button[type=submit]")
or if that doesn't uniquely identify it, maybe this:
elementByCss("#frmResendPassword button[type=submit]")
In English that means a button with type value of submit that has an ancestor of a form where the id(#) is frmResendPassword
This is how I solved it, thanks to mrfreester
it("should send text to phone", function(){
sleep.sleep(5)
return browser
.elementByName("mobileNo")
.sendKeys(usrnme)
.elementByCss("#frmResendPassword button[type=submit]")
.click()
})

how to hide a buttons on page load using javascript

Im new to phone gap,developing an app when a i invoke my app for first time in index page one button should display that is configure the Ip address button .once after the configuring the IP Address, that address will be stored in local storage variable. so when i invoke second time of my application,so in index page their is not required of again configure button instead of that i'm checking the condition that stored variable is null nor not.if it is null again first button will display if not means other three button should display.
how to do that?? i'm not able to hide the button here
Here is my code
HTML:
<div onload="change">
<center> <button class="config" id="config" onclick='return config()'>Configure IP Address</button></center>
<center><input class="username" type="text" placeholder="Username" id="username" value="" ></center>
<center><input class="password" type="password" placeholder="Password" id="password" value=""></center>
<center><button id ="LOGIN" class="login" onclick="loginpostactivity()" >Login</button></center>
JS:
<script>
// Function being used to hide/unhide the button
function changeMessage() {
if (ipAddress!="") {
document.getElementById("config").style.visibility = "visible";
} else {
document.getElementById("username").style.visibility = "hidden";
document.getElementById("password").style.visibility = "hidden";
document.getElementById("LOGIN").style.visibility = "hidden";
}
}
</script>
When i load this page , i want to display the first button if the correct is true, else three button should display .
Perform the two steps below. It probably may solve the issue.
Make the uname pwd and login button hidden in if block
Make the config button visible in else block.

Resources