Is there a React-Select prop for delete on backspace when using non-multi Async? - react-select

I need to be able to clear the selection in the form field when backspace is used. Currently, the any selection is retained in the form field until a new selection is made. I need to be able to clear the selection and show the placeholder again.
This functionality exists in the non-Async version as well as in the Async version, if multi={true} is set. I have tried backspaceRemovesValue={true}, but this prop doesn't seem to be valid for Async.
I expect backspace to remove the form field value in Async as it does for the standard version of React-Select or in the multi- version of Async.

I used isClearable={true} but it brings clear indicator

Related

Opposite of SetFocus

MSAccess VBA:
Assume, in an arbitrary form, the focus is set to MyControl on that form.
How to "unset" the focus without giving the focus to another control?
I'm lokking for a code like
MyControl.UnsetFocus
In your circumstance, you probably want to just set focus back to the parent form. This meets the conditions of unsetting focus without giving another control focus, and tabbing or clicking will activate the focus / tab-navigation again from that form.
Here's an example:
Forms![MyForm].SetFocus
Note that per the documentation for SetFocus, if you attempt to SetFocus to a Form with child controls that have Enabled set, this will cause focus to automatically bounce to the first eligible child control per the documentation.
Form.SetFocus method (Access) # Microsoft Docs
The option to give focus to the parent form does work as proposed by meklarian
Alternatively, I recently had to do something similar but I wanted to update a textbox value and simply go back to whatever had focus before. This is another case where something like an "unsetfocus" would be awesome, but unfortunately doesn't exist.
Should you need to do something like this, the following works well
Screen.PreviousControl.SetFocus

Vue native color picker #input when no change is made

Here's a situation: I have a regular non-Vue component color picker with the simple <input type="color"/> which works almost perfect, except in one case. The case being, when there's already a color existing in the picker and all the user does is click "Ok". I would expect that the vue #input or #change event would fire and set the color value even if the user didn't choose a different color. However, when the user simply clicks "Ok" and does not choose a new color, there is no event fired for either #change or #input. What's a way to fire this event in such a case?
That functionality is unfortunately not available.
You can use #focus, with the caveat that it will fire when you click, and when you exit (cancel or OK)
You could add some custom #blur and #focus events to get something similar, but I think using just #focus (triggered on click too) may work in most scenarios

why does selecting "refresh fields on keyword change" load a whole new document?

Notes 9.01
Why does a new document on the web change unique IDs every time you refresh it?!? this causes all kinds of issues. Obviously it is a different document, so maybe I should re-phrase that, but I think you know what I am saying.
I have a listbox field, with the setting to "refresh fields on keyword change" selected. This allows hide-whens to recalc, and other fields to recalc. I also have a computed text showing the current #DocumentUniqueID.
choices are: "Select one":"one":"two":"three"
When using this form on the web, in a new document, and I pick something in this field from the drop-down, it refreshes the form, and the choice I just picked is removed and "Select one" is what is showing again.
Once the document is saved, this stabilizes and you do not switch documents, and field values do not get cleared. I just want to understand the logic of this and find out how other people work around this.
Any feedback would be great. If I am doing something stupid, please tell me, I can take it.
Matt
I don't know what the "all kinds of issues" that you're dealing with are, but for as far back as I can remember, Notes documents have not had a stable #DocumentUniqueID value (or any at all, actually) prior to being saved for the first time. It's been my practice, and I think pretty widely accepted practice, not to write code that would have issues with that. If it's been necessary to depend on some unique value in the document prior to the first save, I've always used a computed-when-composed field with #Unique for its value.
My suggestion would be to not use "refresh fields on keyword change" for a form used on the web. The way I would handle it is to use some JavaScript to handle that.
Personally I would do this, in your situation:
Add jQuery to the form, you can easily put a CDN link in the page
header.
Write a JavaScript function called (for example)brecalculateFields(). This function would calculate field valuesband perform hide/show of fields/sections of the form.
Set a class for all fields where you want to trigger a recalc of the fields when the value is changed. I would call the class recalcForm.
Bind the function recalculateFields() to the changed event of all fields with the class recalcForm.
You may want to bind the function to a few other events as well, depending on what type of fields you have on the form.
$(".recalcForm").on("change", function(e) {
recalculateFields();
});
$(".recalcForm").on("blur", function(e) {
recalculateFields();
});
I have blogged about this in the past, hopefully you can use some of the info there:
http://blog.texasswede.com/using-jquery-to-emulate-notes-hide-when/
http://blog.texasswede.com/jquery-a-flexible-way-to-showhide-sections/

DataTables YADCF - do not search on arrow key presses

I am looking at this YADCF example:
http://yadcf-showcase.appspot.com/server_side_source.html
Position cursor inside "Browser" column filter field
Press LEFT ARROW key
In Firebug you will notice an outgoing request to pull the data.
Question.
How can I prevent submission of search context if arrow keys are pressed?
Looking at the YADCF source I could not find an appropriate spot. function textKeyUP is triggered by inline JS events and does not know anything about Javascript Event object.
Thanks!
You can grab the 0.8.9.beta.33 in this version the text and auto complete filtes will ignore the arrow keys, if someone want more key to be igore he can send a PR with modified keyCodes

Dijit DateTextArea Behaviour

I am using the dijit dateTextArea and am experiencing some odd behaviour.
I have a simple form with the Dijit dateTextArea. I am setting a default value for the date and it appears fine. If I click into the date area, select a date and hit submit the date is picked up on the other side fine(i.e. it is submitted). If however I don't touch the dateTextArea (i.e. i don't click into it or give it any focus) and submit the form the date is blank, even though the default date has been set. I've tried setting the default date by setting the value on the widget, the initial value and by using data-dojo-props. The date displays in the field but unless I interact with the field the date does not get submitted.
So, what am I doing wrong? Does the field need focus at some point to work properly?
Is there an extra setting I should be using when specifying a default date?
Thanks
It's difficult to tell what's wrong without seeing some code, but you shouldn't have to focus the input or anything for the value to be submitted.
If you look at the "Net" tab in firebug, is the date value part of the request when you submit the form?
I wasn't able to reproduce the problem in jsfiddle.. http://fiddle.jshell.net/DqHxL/ .
How are you referencing the widgit? Is it with dijit.byId or document.getElementById. If you are using dijits you must use dijit.byId not getElement... Dojo creates shadow objects for everything