fix minor focus issues

This commit is contained in:
Elizabeth Hunt 2024-03-04 17:31:25 -07:00
parent 8288d08648
commit 110fe21a23
Signed by: simponic
GPG Key ID: 52B3774857EB24B1
2 changed files with 16 additions and 2 deletions

View File

@ -1,4 +1,10 @@
import { IMAGES, SPRITE_SPECS, SpriteSpec, Sprites } from "../config";
import {
IMAGES,
Miscellaneous,
SPRITE_SPECS,
SpriteSpec,
Sprites,
} from "../config";
import { Entity, EntityNames } from ".";
import {
BoundingBox,
@ -77,7 +83,14 @@ export class FunctionBox extends Entity {
return;
}
modalOpen = true;
openModal(this.code);
openModal(
`<div style="text-align:center"><p>${this.code}</p> <br> <button id="close">Close</button></div>`,
);
document.getElementById("close")!.addEventListener("click", () => {
closeModal();
document.getElementById(Miscellaneous.CANVAS_ID)!.focus();
});
};
this.addComponent(new Interactable(interaction));

1
src/typeshims/rainbowbrackets.d.ts vendored Normal file
View File

@ -0,0 +1 @@
declare module 'rainbowbrackets';