yangzhang75 commented on code in PR #6058:
URL: https://github.com/apache/texera/pull/6058#discussion_r3538609832


##########
frontend/src/app/workspace/component/property-editor/operator-property-edit-frame/numeric-input-parser.util.ts:
##########
@@ -0,0 +1,64 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { FormlyFieldConfig } from "@ngx-formly/core";
+
+/**
+ * Null-safe parser for numeric (integer/number) property fields.
+ *
+ * It replaces @ngx-formly/core's json-schema integer/number parser, which 
reads
+ * `document.querySelector('#' + field.id).validity.badInput`. That code 
assumes the
+ * field id is on the native `<input>`, but ng-zorro's `nz-input-number` puts 
the id
+ * on its host element (which has no `.validity`), so the parser throws
+ * "Cannot read properties of undefined (reading 'badInput')" and typed edits 
never
+ * commit. This version does no DOM access: it just converts the value to a 
number, or
+ * null when it is empty/undefined/not a number.

Review Comment:
   Confirmed it's fixed in 7.1.0, they added the `input.validity` guard our 
6.3.12 lacks, and 7.1.0 still supports our Angular. 
   Do you want me to upgrade to 7.1.0 instead of this workaround?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to