Bug 1853030 - [devtools] Set more specific key for FontName. r=jdescottes,devtools-reviewers.

For a given family, we can get multiple time the same font
returned by the server. In such case, we had duplicated keys,
which seemed to cause trouble in the React render cycle, ultimately
causing to render more font than what was sent from the server.

Differential Revision: https://phabricator.services.mozilla.com/D223144
This commit is contained in:
Nicolas Chevobbe 2024-09-24 08:42:24 +00:00
parent 0d46faca9e
commit 21776e8caa

View File

@ -152,9 +152,9 @@ class FontEditor extends PureComponent {
}
renderFontGroup(family, fonts = []) {
const group = fonts.map(font => {
const group = fonts.map((font, i) => {
return FontName({
key: font.name,
key: font.name + ":" + i,
font,
onToggleFontHighlight: this.props.onToggleFontHighlight,
});