Page MenuHomePhabricator

[MEX] M4.1.3 Investigate and fix binding between CdxTextInput and CdxLookup in apiItemLookup
Closed, ResolvedPublic

Description

In T405731 we refactored our use of CdxLookup components so that lookups populated by Wikibase API responses use a common component - the apiItemLookup component.

This component takes a lookupSource as a property, and the lookupSource needs to be able to watch changes to the text input of the CdxLookup.

The current implementation uses @input="onInput" to update the lookupSource's lookupInputValue, but also uses v-model:input-value="lookupInputValue" to bind the same. The @input="onInput" should be redundant, and is unnecessary if the lookup is visible when the edit form loads. But without the @input declaration the lookupSource is not able to watch changes to the text input if the CdxLookup is loaded later (e.g. after switching from a novalue to a somevalue snak).

Steps to reproduce

  • remove the @input="onInput" from the apiItemLookup
  • edit a statement that has a novalue snak for a lookup property (e.g. entity or tabular-data / geo-shape)
  • change the novalue to custom
  • type in the input box
  • observe that the search is not triggered and the drop-down remains empty.

Acceptance Criteria

  • The apiItemLookup should work in all situations, without the double watch - either v-model:input-value= or @input= should be used

Note: As there is a working solution and since this is technically an investigation, we've added a timebox :
Timebox: 4 hours

Event Timeline

karapayneWMDE subscribed.

reviewed in task time on 11.02.2026 and is ready to be pulled into the backlog once T405731: [MEX] M4.1.6 -FUNC - quantities is complete

Change #1240863 had a related patch set uploaded (by Arthur taylor; author: Arthur taylor):

[mediawiki/extensions/Wikibase@master] Remove double-binding of apiItemLookup CdxLookup inputValue

https://gerrit.wikimedia.org/r/1240863

Change #1240863 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Remove double-binding of apiItemLookup CdxLookup inputValue

https://gerrit.wikimedia.org/r/1240863