Disable autofill/ type ahead in AQS relational fields

In relational input fields when you type a query, it shows predictions in dropdown using quicksearch.js and it also auto fills the input field with best prediction to what you’ve already typed(eg: If you typed ‘ma’ and if the top prediction is ‘Mark Joseph’ it will fill the input with ‘Mark Joseph’ with ‘rk Joseph’ selected). but You might want to turn this feature off in some scenarios.

To do that, you need to falsify the ‘typeAhead’ property of respective QSField in the ‘QSFieldsArray’. You can achieve that by adding ‘sqsNoAutofill’ class to the input field using injected custom code in viewdefs. If you want to disable the quicksearch feature completely remove the ‘sqsEnabled’ class from the input element.

If you have better suggestions please do share!

1 Like