Skip to content

Commit

Permalink
[cdb] Prevent enter in tilepicker inputs from closing the modal
Browse files Browse the repository at this point in the history
  • Loading branch information
EspeuteClement committed Nov 18, 2024
1 parent 6bfecef commit e207135
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions hide/comp/cdb/Cell.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,13 @@ class Cell {
//var modal = new hide.comp.Modal(new Element(elementHtml));
//modal.modalClick = function(_) closeEdit();

var modalHtml = modal.element.get(0);

modalHtml.addEventListener("keydown", (e: js.html.KeyboardEvent) -> {
// Block all keyboard events from reaching the editor
e.stopPropagation();
});

inline function usesSquareBase(t : cdb.Types.TilePos) {
return t.size != 1
|| t.x / t.width != Math.floor(t.x / t.width)
Expand Down

0 comments on commit e207135

Please sign in to comment.