Summary
The Lookup component's initialInputValue prop was initially added as a workaround to avoid adding a v-model prop for the input value. Most dev users of Lookup don't need to read or write the input value, so it is just tracked inside Lookup, and initialInputValue was added as a way to set only the initial value if needed.
However, there is now a Wikifunctions use case for setting an initial input value that is later updated once more data about the initially selected item is fetched. They're getting around this by tricking the Lookup into re-rendering via a key, but ideally they could use a reactive prop as is supported by other components.
Original report
Solution
We recently added a composable that enables a component to have an optional prop that is bound by v-model. We can use this inside Lookup to add a new inputValue prop that can be used to give the parent component control over reading and writing the input value. This can replace the initialInputValue prop, which can be deprecated and will be removed in Codex 2.0.
Acceptance criteria
- Lookup has a new optional prop, inputValue, that is bound via v-model
- The inputValue is used if provided, otherwise the Lookup will create an internal ref that defaults to the initialInputValue if provided or an empty string if not
- initialInputValue is deprecated
- A new demo is added to show how to set an initial selection and input value