Skip to content

GEM: NumberPropertyEditorにおいて、最大文字数の設定が反映されない #1882

@KoheiKGYM

Description

@KoheiKGYM

概要

IntegerPropertyEditor、DecimalPropertyEditor、FloatPropertyEditorで「最大文字数」を設定しても、HTML の maxlength 属性が出力されず、入力文字数の制限が効かないので修正する。

#1261 の修正で発生したデグレだと思われる。
※ MetaNumberPropertyEditor の fillTo() メソッドから、pe.setMaxlength(maxlength); の記述が削除されている。

再現手順

  1. Integer型(またはDecimal/Float型)プロパティのPropertyEditorを編集
  2. 「最大文字数」に任意の値(例:5)を設定して保存
  3. 該当Entityの編集画面を開く
  4. ブラウザの開発者ツールでinput要素を確認 → maxlength属性が出力されていない
  5. 入力フィールドに設定した最大文字数以上の文字を入力 → 制限なく入力できてしまう

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions