MUI Autocomplete — display all filter options - reactjs

I had implemented a dropdown select in my react/mui app using the Select component; however, there were often several thousand options to choose from and implementing react-window in Select turned out to be a nightmare. So I plumped instead to use Autocomplete.
However my client has complained that all of the options need to be available, even if an option has already been chosen — that is, if there is text in the input. Which is expected behaviour, of course, since it is an autocomplete.
So I have been wrestling for the last several hours to display all of the options, even if there is text in the input, trying lots of different things:
looking for some prop option to display all the options, not just those that match. Doesn't seem to exist
trying to clear the text input when it is focussed. Tried several methods of doing this, such as:
listening to open and clearing the text field itself
manually clicking the "clear" button on open. This is a problem because the open state of the dropdown changes and it really isn't very reliable to determine if it is open or not, and should be re-opened
Anyone had this problem?

Related

Can't Change Checkbox Labels

I am unable to edit the labels for a set of checkboxes in my Excel file. The checkboxes were created using Form Controls (not ActiveX). I have been working with this file for many years and now suddenly cannot make any changes. I have tried editing them by clicking on Edit Text or by double clicking on the label itself. In both cases, the cursor does not activate. I also noticed that the font size of the text is smaller than in prior versions of the document, but the font size was never purposely changed.
On a separate note, the file also contains option buttons that do not always work. The button does not fill in when clicked on or there may be a delay. This is a new problem, too. I am not asking for help on this issue in this post but am providing it informationally in case it helps in determining what may be happening with the checkboxes. I appreciate any help.

clearing a material-UI autocomplete field on the press of a button

I am using material-UI autocomplete for a project that involves rendering a dynamic array based on what you select from the menu. I am finished with the project and now trying to implement multi-select to make choosing things from the menu easier. When you have everything you want from the menu, you click an "Add" button that takes everything you currently have selected and adds it to a table (and adds the properly formatted text into a query on the side, the goal is to build queries for users without them worrying about syntax). When I was not using multiselect, and only adding one thing at a time to the query, I was easily able to clear the autocomplete field by changing the value prop to null. This prevents users from adding the same fields to the query over and over (when add is clicked the options that were added are popped from the list of options). When using multi the rules seem to change and now changing value directly causes an error. My question is, does anyone know of a way to programattically click the x button built in to material-ui autocomplete fields to clear that text field in an event handler? Or is there any reliable way of clearing that on my end?

How to get a callback from TextArea on each change?

in my app, when editing a record, I've added an ActionListener to save a temporary copy of the edited values for each field automatically, so that if the app is put in the background and then stopped, the edited values can be recovered when the app is started up again.
However, with the TextAreas it doesn't work since actionListeners don't get called unless the user takes some action (like leaving the field). I need to use the TextArea since there can be multiple lines of text, so using a DataChangedListener for a TextField as suggested in this thread does not seem a viable solution. And being able to save the TextAreas is important to achieve good UX since the user likely loses more work when text is dropped than if for example a value set in a Picker is lost.
Is there another way to achieve this result?
Thanks in advance
TextField allows multiple lines using setSingleLineTextArea(false). When invoked it will function similarly to TextArea.

AutoCompleteTextField completion strings display issue

I've made a form in the GUI builder that has 5 auto complete text fields. All are made in exactly the same way with their completion arrays set before the form is shown, also in exactly the same way. The first two fields work as expected. The second two fields only show their completion options after some of the picker components are used on the form (they are in the same container), and the last one never shows completion options (or is showing them off screen?).
This looks related to Codename One - AutoComplete popup window location which in turn refers to two open bugs both of which are scheduled for this release cycle:
https://github.com/codenameone/CodenameOne/issues/1687
https://github.com/codenameone/CodenameOne/issues/1697

Paginated Drop Down Angular js

I have a dropdown containing 100+ options in it. Can it be paginated so that when user selects the dropdown it shows only 10 options with pager.Is there any angular plugin to do so.Thanks
I've personally never seen such a widget and i think it's a bit weird to be honest. The user wouldn't expect that behaviour from a dropdown which harm the usability quite a bit.
I would recomment to simply use a normal dropdown instead - if you think of a standard country-dropdown for example (Germany, France, Italy etc.) it holds around 100 entries as well but doesn't do some unexpected behaviour like pagination in it.
The standard select doesn't support this behaviour for sure and i'm not aware of any public widget that does.
So if you really want to do this you will probably have to implement it on your own.
Yes it can, but the pagination should happen a little bit special way. There is a plugin, called ngInfiniteScroll which does the pagination based on where additional content for a web page is appended dynamically to the bottom of the page as the user approaches the end of the content.
You may try to use this, but then you have to have your custom dropdown built. In this way you can achieve a convenient usage of a dropdown without showing 100+ hits on start.
ngInfiniteScroll website: https://sroze.github.io/ngInfiniteScroll/

Resources