Fixed "allowClear" when no "placeholder" is set (AssociationField)#3944
Fixed "allowClear" when no "placeholder" is set (AssociationField)#3944javiereguiluz merged 1 commit intoEasyCorp:masterfrom
Conversation
|
@javiereguiluz I'm afraid that #3925 introduced this regression. And now I think that my solution might not be enough since the bug also affects other If you have any preferred solution I can implement it and update this PR. Thank you! |
|
@liarco I saw this error a few days ago in one of my apps ... but now I cannot reproduce it anymore. Could you please update to the latest |
|
Hi @javiereguiluz, I tested using a1d8c1d and now association inputs with I'm testing a brand new entity with a property which can be Forcing the Please let me know if there's anything else I can do to help you troubleshooting. |
|
Thanks for the new insights and the perfect GIF showing the problem. LEt's merge this! Thanks! |

When trying to clear an AssociationField I get an error from Select2:

This seems to be related to: https://stackoverflow.com/questions/49953467/cannot-read-property-id-of-undefined-select2
Select2 doc: https://select2.org/selections#clearable-selections
My solution: I simply check if
allowClearis set (and true), then ifplaceholderis not set I set it to an empty value.I tried to fix this in a simple way, but maybe you prefer a different solution, let me know.
Thank you for your time.