File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -302,19 +302,21 @@ export default {
302302 }
303303 document .querySelector (this .output_selector ).innerHTML = html;
304304 },
305+ /**
306+ * Auto-selects identifier type dropdown based on input pattern (e.g., Q12345 → Wikidata).
307+ * Only selects types available in the current page's identifier config.
308+ * Enables autodetect for editions/works (previously author-only).
309+ */
305310 selectIdentifierByInputValue : function () {
306- // Ignore for edition identifiers
307- if (this .saveIdentifiersAsList ) {
308- return ;
309- }
310- // Selects the dropdown identifier based on the input value when possible
311311 for (const idtype in identifierPatterns) {
312312 if (this .inputValue .match (identifierPatterns[idtype])){
313- this .selectedIdentifier = idtype;
314- break ;
313+ /** Only select identifier types available in page config (prevents selecting unsupported types) */
314+ if (this .identifierConfigsByKey && this .identifierConfigsByKey [idtype]) {
315+ this .selectedIdentifier = idtype;
316+ break ;
317+ }
315318 }
316319 }
317-
318320 }
319321 }
320322}
You can’t perform that action at this time.
0 commit comments