ReactSearchAutocomplete DO NOT select the first option when writing - reactjs

I use this code https://codesandbox.io/s/intelligent-sun-f73pn9?file=/src/App.js
in my project and it becomes different from what appears.
When I write in the search box the first option is not selected.
where when I use it in my project the first option is always selected.
Same here: https://codesandbox.io/s/sleepy-kate-7k3xo7?file=/src/serviceWorker.js
Please if u know the reason help me with that.
How I can do not select the first option always like the first code?

Related

Umbraco cms AngularJS Regular Expression Keep appearing

Umbraco uses angularJS as based library and backoffice totally developed on it. The reason telling first is to tell that I have a field on which URL regular expression applied. If someone entered invalid url like below image
it shows error as need.
But if a user try to remove whole text by selecting it and removing at once. It still keep appearing the error like this
However, if a user erase text one by one like this
then the validation error removed and user need to click on button to see error again.
I would to know how screen 3 state can be achievable when user remove all text together? Its really annoying behavior for a user to remove text character one by one to refresh the state of the field. Screen 3 state should be applied on screen 2.
Can anybody tell me how it can fix or achievable? Right now, it seems like a default behavior.
Looking forward to hear from you guys. Suggestions will be much appreciatable.
Regards o
I've looked into this issue. This seems to be a product bug.
When you remove whole text at once, newValue is an empty string and the code responsible for resetting error messages doesn't run. If you have access to the umbraco code, you can easily fix it by removing highlighted check:

How to save codes on VS Code Mac?

I am using VS Code on a Mac to write ReactJS, however I find that I could not save my code. If I use command and s to save, then the JSX will be a mess, just like shown in the picture:
enter image description here
So how could I solve it? Thank you
I think your code is being saved, but that your code formatting is messing-up your code.
Hit the following combination : Shift+Command+P
This will open a menu on top. Inside that menu type Format Document With..., and select it. It will allow you to format your code with a different auto-format tool. Choose the one that is appropriate for your code i.e. Prettier.

Protractor click element only when present

Alright, so I thought this would be easy but I've spend a few hours searching and trying different methods with no avail. I need to tell protractor to only click on a button when it is present. To water it down basically my test checks if a certain value is present on a page. The page can be in one of two states, automatic mode, which contains my value I'm testing or design mode, which contains other values which are irrelevant for this test. If its in design mode, we first need to click on automatic mode which produces a prompt asking us if we are sure we want to continue and switch to automatic mode - this prompt contains the continue button I need to check for and click. If the page is already in automatic mode however, I don't need to perform this check, I can proceed to validate weather or not my value is present. Basically I tried this:
if (continueButton.isDisplayed()) {
continueButton.click();
}
what happens I get a "No element found using locator:..." error. I tried a few different ways such as using isElementPresent, and some of the expected condition options but more or less I get the same results. How can I achieve this scenario where my test checks if a button is present and clicks it, and if it isn't present continues with the test.
You can achieve this by using promises.
continueButton.isDisplayed().then(function (isDisplayed) {
if(isDisplayed){
continueButton.click();
}
});
browser.wait() and elementToBeClickable Expected Condition is exactly what might help:
var EC = protractor.ExpectedConditions;
browser.wait(EC.elementToBeClickable(continueButton), 5000);
continueButton.click();

Excel: apply conditional formatting if cell contains one of x strings

What I'm trying to do should be quite simple but I am getting error messages saying that conditional formatting doesn't accept this method.
So I am looking for a fix or an alternative.
What I have is a list of search texts for phone faults
screen broken
wifi not working
bluetooth dead
the dooflip isnt working
etc.
I have also set up a number of common keywords
screen
wifi
bluetooth
By comparing these two we can see that the last one doesn't adhere to any of my common keywords, and so I want it highlighted/ copied somewhere etc. so I can view and take any action.
So far I have attempted to set up conditional formatting to search the terms for the keywords and if it doesn't contain any then highlight it.
=ISERROR(SEARCH({"wifi", "bluetooth", "screen"},$H$117))
When using this I get informed that conditional formatting does not support arrays (it works fine if I only specify one search term).
If i create a table with all the keywords in and use the following it works, however it will only find direct mataches, and wont search for the word in the cell string
=ISERROR(MATCH(<cell_to_change_colour_of>, <keyword_table>,0))
So is there another way of doing this?
my answer requires MOREFUNC addon*
=REGEX.COMP(A1,"wifi|bluetooth|screen",FALSE)
this will return true if any of the words appear anywhere in cell A1. FALSE in the formula stipulates that it is not case sensitive.
Unfortunately due to Excell's stupid rules it will not work directly in Conditional Formatting box. You will need to place it in a helper column, and point the conditional formatting rule to that column.
MOREFUNC ADDON
Morefunc Addon is a free library of 66 new worksheet functions.
HERE is some information (by original author)
here is the last working download link I found
here is a good installation walk-through video

KDevelop: transform selected text?

I was wondering whether there was a function in KDevelop similar to the one that we used to have in Quanta (miss you, Quanta, btw).
I would like to set a keyboard shortcut, and apply a text transformation upon hitting it. Example:
I select my text to be translated, and I get back: <?=_('my text to be translated'?>
As you can see, this saves me a lot of awkward keystrokes...
I only found this feature in PHPStorm (where it is called "Live Templates"). I defined it like this: <?=t('$SELECTION$')?> and I can call it by hitting CTRL+ALT+J, and select it from the dropdown that appears.
You should be able to do that using a snippet with the following text: <?=_('%{selection}'?>
And you can bind a Shortcut to a snippet.
However my tests showed that this doesn't work correctly - there seems to be a bug somewhere.
As alternative you can write a script that does insert the text. See the documentation.

Resources