Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/alpinejs/src/directives/x-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function getInputValue(el, modifiers, event, currentValue) {
// Safari autofill triggers event as CustomEvent and assigns value to target
// so we return event.target.value instead of event.detail
if (event instanceof CustomEvent && event.detail !== undefined)
return event.detail ?? event.target.value
return event.detail !== null && event.detail !== undefined ? event.detail : event.target.value
else if (el.type === 'checkbox') {
// If the data we are binding to is an array, toggle its value inside the array.
if (Array.isArray(currentValue)) {
Expand Down
4 changes: 3 additions & 1 deletion packages/mask/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ export function formatMoney(input, delimiter = '.', thousands, precision = 2) {
if (input === '-') return '-'
if (/^\D+$/.test(input)) return '9'

thousands = thousands ?? (delimiter === "," ? "." : ",")
if (thousands === null || thousands === undefined) {
thousands = delimiter === "," ? "." : ","
}

let addThousands = (input, thousands) => {
let output = ''
Expand Down