Skip to content

Commit

Permalink
Fix double-escape of application IDs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fyorl committed Nov 8, 2024
1 parent f529114 commit a1d6aa9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default class BaseProficiencyConfig extends BaseConfigSheet {
/** @inheritDoc */
_initializeApplicationOptions(options) {
options = super._initializeApplicationOptions(options);
options.uniqueId = `${options.trait}-${options.key}-${options.document.uuid}`;
options.uniqueId = `${options.trait}-${options.key}-${options.document.uuid}`.replace(/\./g, "-");
return options;
}

Expand Down
2 changes: 1 addition & 1 deletion module/applications/actor/config/traits-config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default class TraitsConfig extends BaseConfigSheet {
if ( !CONFIG.DND5E.traits[options.trait] ) throw new Error(
`Cannot instantiate TraitsConfig with a trait not defined in CONFIG.DND5E.traits: ${options.trait}.`
);
options.uniqueId = `${options.trait}-${options.document.uuid}`;
options.uniqueId = `${options.trait}-${options.document.uuid}`.replace(/\./g, "-");
return options;
}

Expand Down
2 changes: 1 addition & 1 deletion module/applications/api/application-v2-mixin.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default Base => class extends HandlebarsApplicationMixin(Base) {
const applicationOptions = super._initializeApplicationOptions(options);
// Fix focus bug caused by the use of UUIDs in application IDs
// TODO: Remove once https://github.com/foundryvtt/foundryvtt/issues/11742 is fixed
applicationOptions.uniqueId = CSS.escape(applicationOptions.uniqueId);
applicationOptions.uniqueId = applicationOptions.uniqueId.replace(/\./g, "-");
return applicationOptions;
}

Expand Down
2 changes: 1 addition & 1 deletion module/applications/shared/movement-senses-config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default class MovementSensesConfig extends BaseConfigSheet {
/** @inheritDoc */
_initializeApplicationOptions(options) {
options = super._initializeApplicationOptions(options);
options.uniqueId = `${options.type}-${options.document.uuid}`;
options.uniqueId = `${options.type}-${options.document.uuid}`.replace(/\./g, "-");
return options;
}

Expand Down

0 comments on commit a1d6aa9

Please sign in to comment.