select2 icon indicating copy to clipboard operation
select2 copied to clipboard

How to stop typing when maximumSelectionLength is reached?

Open boubou1030 opened this issue 11 years ago • 3 comments

I'm using select2 4.0. Can we set the constraint that users can not type in any character when the maximumSelectionLength is reached? Thanks.

boubou1030 avatar Apr 13 '15 07:04 boubou1030

I think we previously set a maxlength attribute on the search box which would accomplish what you are looking for.

Though it doesn't trigger the message below if it's used, which is something we never really figured out how to work around.

kevin-brown avatar Apr 13 '15 19:04 kevin-brown

I'd really like to see maxlength implemented! I assumed (fail) upon reading the docs, that the standard way of limiting input lengths would be enforced.

@kevin-brown is there any way to not show the message and get that maxlength attribute added by using a custom adapter with select2 4.0? I'm really not sure how I would go about this but need that behavior! Any help you could provide would be appreciated.

ttucker avatar Jun 19 '15 17:06 ttucker

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 13 '19 16:03 stale[bot]