mirror of
https://gitgud.io/BondageProjects/Bondage-College.git
synced 2025-04-25 17:59:34 +00:00
BUG: Fix crafted names with characters larger than /u+FFFF being invalid
This commit is contained in:
parent
4a7e328da6
commit
2f88d178f7
1 changed files with 9 additions and 3 deletions
|
@ -421,7 +421,7 @@ var CraftingEventListeners = {
|
|||
|
||||
/**
|
||||
* @private
|
||||
* @type {(this: HTMLTextAreaElement, ev: Event) => void}
|
||||
* @type {(this: HTMLTextAreaElement | HTMLInputElement, ev: Event) => void}
|
||||
*/
|
||||
_InputDescription: function _InputDescription() {
|
||||
this.setCustomValidity(this.value.match(this.dataset.pattern) ? "" : "patternMismatch");
|
||||
|
@ -1097,9 +1097,15 @@ function CraftingLoad() {
|
|||
children: [
|
||||
{ tag: "span", children: [TextGet("EnterName")] },
|
||||
{
|
||||
// NOTE: Perform the pattern checking via JS as there are differences in how plain JS `RegExp` and `HTMLInputElement.pattern`
|
||||
// handle their pattern matching with characters larger than /u+FFFF
|
||||
tag: "input",
|
||||
attributes: { id: CraftingID.nameInput, type: "input", maxLength: "30", size: 0, pattern: CraftingDescription.Pattern.source },
|
||||
eventListeners: { change: CraftingEventListeners._ChangeName },
|
||||
attributes: { id: CraftingID.nameInput, type: "input", maxLength: "30", size: 0 },
|
||||
dataAttributes: { pattern: CraftingDescription.Pattern.source },
|
||||
eventListeners: {
|
||||
change: CraftingEventListeners._ChangeName,
|
||||
input: CraftingEventListeners._InputDescription,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue