[FIX] web: make AutoComplete's value optional
The recent use of owl AutoComplete component in the website builder broke some things (see [1]). This commit handles this bug: Steps to reproduce: - Go to /web?debug=1 - Go to the website app - Enter edit mode - Drop the text-image snippet => Traceback This was because the AutoCompleteWithPages extension of website was inheriting the AutoComplete props whose "value" prop was not optional but was not used for this case. This commit goes the easy way: make the original prop optional with the default value being the empty string. [1]: https://github.com/odoo/odoo/commit/86a9171ec7790aa09f2b9a50dcb26deb029e8bed closes odoo/odoo#141751 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
@@ -371,7 +371,7 @@ export class AutoComplete extends Component {
|
||||
Object.assign(AutoComplete, {
|
||||
template: "web.AutoComplete",
|
||||
props: {
|
||||
value: { type: String },
|
||||
value: { type: String, optional: true },
|
||||
id: { type: String, optional: true },
|
||||
onSelect: { type: Function },
|
||||
sources: {
|
||||
@@ -398,6 +398,7 @@ Object.assign(AutoComplete, {
|
||||
class: { type: String, optional: true },
|
||||
},
|
||||
defaultProps: {
|
||||
value: "",
|
||||
placeholder: "",
|
||||
autoSelect: false,
|
||||
dropdown: true,
|
||||
|
||||
Reference in New Issue
Block a user