open-admin icon indicating copy to clipboard operation
open-admin copied to clipboard

Javascript error on JSON table field

Open lluisandreu opened this issue 2 years ago • 0 comments
trafficstars

Describe the bug I have JSON table field with: a "select" field, a "currency" field and a "number" field. When I create the second row I get the following JS error:

choices.min.js:2 Uncaught TypeError: Expected one of the following types text|select-one|select-multiple
    at new e (choices.min.js:2:3137)
    at HTMLDivElement.<anonymous> (create:904:35)

and the following JS events stops working (number field minus and plus, etc)

To Reproduce Use this table field:

$form->table('prices', __('Tabla de precios'), function ($table) {
            $table->select('operator', __('Operador'))->options([
                '>=' => '>=',
                '='  => '='
            ])->default('>=');
            $table->number('days', __('Días'))->min(0)->default(1);
            $table->currency('price', __('Price'))->symbol("€")->default(0);
        });

Expected behavior A clear and concise description of what you expected to happen.

System

  • Open-admin version: 1.0
  • PHP version: 8.1
  • Laravel Version: 10.x
  • OS: [e.g. Linux / Win / Mac]. Mac
  • Browser [e.g. chrome, safari]: Chrome

lluisandreu avatar Jul 24 '23 15:07 lluisandreu