fix: avoid Array.prototype.at() to support the declared browser range#602
Merged
Conversation
Array.prototype.at() requires Chrome 92 / Safari 15.4 / iOS 15.4, but .browserslistrc declares Chrome >= 60 and Safari >= 12, and the build does not polyfill (no useBuiltIns). Replace .at(-1) with index access so ChipInput, ChipSet and the calendar util run on the supported browsers.
Coverage Report for CI Build 29295672217Coverage increased (+0.02%) to 94.655%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
This was referenced Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes #565.
Array.prototype.at()requires Chrome 92 / Safari 15.4 / iOS 15.4, but the committed.browserslistrcdeclares Chrome >= 60, Safari >= 12, iOS >= 12, and the build only transpiles syntax — it does not polyfill (.babelrc.jshas nouseBuiltIns). So on the supported older browsers.at()isundefinedand throws.#565 fixed only the two calendar usages. This replaces all
.at()calls injs/src:util/calendar.js—weeks.at(-1)→weeks[weeks.length - 1](×2)chip-input.js—chips.at(-1)/parts.at(-1)→ index access (×4)chip-set.js—chips.at(targetIndex)→chips[targetIndex < 0 ? chips.length + targetIndex : targetIndex](preserves negative-index semantics;_navigateToEdgeis called with0and-1)Behavior is unchanged; existing chip/calendar suites pass (2994). Original calendar fix by @vladrusu (#565).