Skip to content

Commit a5a3644

Browse files
committed
fixed a bug in ui:choice
1 parent 4485d5d commit a5a3644

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/widgets/forms.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,10 @@ field[ns.ui('Choice').uri] = function (
808808
for (p in possibleProperties.dp) possible.push(kb.fromNT(p))
809809
opts.disambiguate = true
810810
}
811+
812+
const object = kb.any(subject, property)
813+
if (object) possible.push(object)
814+
811815
return sortByLabel(possible)
812816
}
813817

@@ -1775,9 +1779,6 @@ export function makeSelectForChoice (
17751779
if (options.multiSelect) select.setAttribute('multiSelect', 'true')
17761780
select.currentURI = null
17771781

1778-
const object = kb.any(subject, predicate)
1779-
if (object) select.currentURI = object
1780-
17811782
for (const uri in uris) {
17821783
select.appendChild(createOption(uri))
17831784
}
@@ -1892,6 +1893,5 @@ export function makeSelectForChoice (
18921893
select.addEventListener('change', onChange, false)
18931894
}
18941895

1895-
select.refresh()
18961896
return select
18971897
} // makeSelectForChoice

0 commit comments

Comments
 (0)