mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: ensures fields are correctly unregistered (#31329)
Ember workaround to ensure that a field with the same name is correctly destroyed/created when changing the params and then correctly calling registerField/unregisterFIeld.
This commit is contained in:
parent
2b996a9d39
commit
3f0e84054b
@ -15,7 +15,9 @@ export default class FKObject extends Component {
|
||||
}
|
||||
|
||||
get keys() {
|
||||
return Object.keys(this.objectData);
|
||||
return Object.keys(this.objectData).map((name) => {
|
||||
return { name };
|
||||
});
|
||||
}
|
||||
|
||||
entryData(name) {
|
||||
@ -24,7 +26,7 @@ export default class FKObject extends Component {
|
||||
|
||||
<template>
|
||||
<div class="form-kit__object">
|
||||
{{#each this.keys key="index" as |name|}}
|
||||
{{#each this.keys key="name" as |key|}}
|
||||
{{yield
|
||||
(hash
|
||||
Field=(component
|
||||
@ -62,8 +64,8 @@ export default class FKObject extends Component {
|
||||
remove=@remove
|
||||
)
|
||||
)
|
||||
name
|
||||
(this.entryData name)
|
||||
key.name
|
||||
(this.entryData key.name)
|
||||
}}
|
||||
{{/each}}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user