From f0e638c8043ea8e39ecb1aeb831abe8f4bd8c2c4 Mon Sep 17 00:00:00 2001 From: Dan Wilson Date: Tue, 4 Apr 2023 16:32:40 -0600 Subject: [PATCH] avoid re-rendering input and therefore entering infinite update loop --- src/mask.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mask.ts b/src/mask.ts index c894c08..e3efd67 100644 --- a/src/mask.ts +++ b/src/mask.ts @@ -33,7 +33,7 @@ export class Mask { if (Array.isArray(opts.mask)) { if (opts.mask.length > 1) { - opts.mask.sort((a, b) => a.length - b.length) + opts.mask = [...opts.mask].sort((a, b) => a.length - b.length); } else { opts.mask = opts.mask[0] ?? '' }