Skip to content

Commit

Permalink
Merge pull request #1976 from googlefonts/font-overview-cell-response…
Browse files Browse the repository at this point in the history
…-issue-1975

[font overview] Force cell update on selected font-level changes
  • Loading branch information
justvanrossum authored Jan 22, 2025
2 parents 0cfce28 + 7e1d0c7 commit e951c09
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/fontra/views/fontoverview/fontoverview.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,22 @@ export class FontOverviewController extends ViewController {
this._updateGlyphItemList();
});

this.fontController.addChangeListener(
{ sources: null, customData: { "fontra.sourceStatusFieldDefinitions": null } },
() => {
/*
* The glyph cells may need updating because of changes in the font sources
* (eg. the ascender/descender values determine the relative glyph size in
* the cells) or because the status definitions changed.
* Trigger active cell update by setting the location again. It has to be
* a distinct object, as the ObservableController ignores "same" objects
*/
this.fontOverviewSettings.fontLocationUser = {
...this.fontOverviewSettings.fontLocationUser,
};
}
);

document.addEventListener("keydown", (event) => this.handleKeyDown(event));

this._updateGlyphItemList();
Expand Down

0 comments on commit e951c09

Please sign in to comment.