mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
fixup! [IMP] qweb: introduce t-model directive
This commit is contained in:
committed by
Géry Debongnie
parent
233c953243
commit
4bdfaf96f3
@@ -18,8 +18,9 @@ export function createEventHandler(rawEvent: string): EventHandlerCreator {
|
||||
}
|
||||
|
||||
// Native listener
|
||||
let nextNativeEventId = 1;
|
||||
function createElementHandler(evName: string, capture: boolean = false): EventHandlerCreator {
|
||||
let eventKey = `__event__${evName}`;
|
||||
let eventKey = `__event__${evName}_${nextNativeEventId++}`;
|
||||
if (capture) {
|
||||
eventKey = `${eventKey}_capture`;
|
||||
}
|
||||
|
||||
@@ -350,13 +350,6 @@ function parseDOMNode(node: Element, ctx: ParsingContext): AST | null {
|
||||
const hasNumberMod = attr.includes(".number");
|
||||
const hasTrimMod = attr.includes(".trim");
|
||||
const eventType = isRadioInput ? "click" : isSelect || hasLazyMod ? "change" : "input";
|
||||
const similarTOnEvent = nodeAttrsNames.find((a) => a.startsWith(`t-on-${eventType}`));
|
||||
|
||||
if (similarTOnEvent) {
|
||||
throw new Error(
|
||||
`Conflicting t-model and ${similarTOnEvent} directives on event type: ${eventType}`
|
||||
);
|
||||
}
|
||||
|
||||
model = {
|
||||
baseExpr,
|
||||
|
||||
Reference in New Issue
Block a user