Open stefanlesik opened 4 years ago
@stefanlesik Rejecting a promise means that particular update won’t happen.
It doesn’t reset the value.
For an example,
Current Value: iphone
User typed X
then it became iphoneX
and if we have some logic to reject the promise for iphoneX
value then the update won't happen and the value will be same as iphone
.
You said that after rejecting a promise it doesn't allow to enter the inputs further, can you please share the codesandbox link for the same?
thanks for your speedy reply @bietkul . Here's a Sandbox (try typing a a a a
for example): https://codesandbox.io/s/datasearch-6vf3u?file=/src/index.js
Thanks, for the CSB
link. I can see the issue there.
Thanks. Is there a workaround in the meantime you could suggest?
@stefanlesik Use controlled behavior to control the value updates. https://docs.appbase.io/docs/reactivesearch/v3/advanced/usage/#controlled-components
React
There's a default ElasticSearch limit of 1024 clauses within a query. Users may reach this limit when pasting a long list of values to search against within the DataSearch component. In my case it crashes ElasticSearch and returns the error "caused_by":{"type":"too_many_clauses","reason":"maxClauseCount is set to 1024"}.
It would be great if there was a way of setting a limit/validating entries once this limit is reached to prevent ElasticSearch from crashing. I'm trying to solve this by using beforeValueChange to reject the entry if it's greater than 1024. But I need to be able to reset the promise and the value the user has entered so they can start again. With the code below, the promise is rejected and the user can no longer edit the input. Any suggestions? Thanks