Limit selections of images


is there any way to limit the selection of Images when Image is chosen as type?
I have tried:
“maxlength”: 1
but it is not working.

That’s not possible right now. I wrote a fix a while ago for a custom TinyMCE addon with an image selection, where I always expected a single selection. It’s not complicated to fix it, but the assets component would have to check the field type so it knows, if it was called from gallery (multiple) or image/asset/html/wysiwyg/markdown/… (single).

I don’t have the time right now, but here is the snippet to deselect all assets except the last clicked one in a wysiwyg field:

And here is the part, where a check could be implemented: