SunRiseGG 4 лет назад
Родитель
Сommit
33e1ad2adb
2 измененных файлов с 8 добавлено и 5 удалено
  1. 2 0
      priv/js/nitro.js
  2. 6 5
      src/elements/combo/element_comboLookupEdit.erl

+ 2 - 0
priv/js/nitro.js

@@ -40,6 +40,8 @@ function querySourceRaw(Id) {
         default:
             if (el.getAttribute('data-vector-input')) {
                 val = querySourceRaw(el.children[1].id);
+            } else if (el.getAttribute('data-edit-input')) {
+                val = querySourceRaw(el.children[0].children[0].children[0].id);
             } else if (el.getAttribute('data-sortable-list')) {
                 val = getSortableValues('#' + el.id);
             } else if (el.contentEditable === 'true') {

+ 6 - 5
src/elements/combo/element_comboLookupEdit.erl

@@ -10,17 +10,18 @@ render_element(#comboLookupEdit{id=Id, input=Input, disabled=Disabled, validatio
   nitro:render(
     #panel{
       id = Id,
+      data_fields = [{<<"data-edit-input">>,<<"data-edit-input">>}],
       body = [
         #panel{
           style = "display: flex; position: relative; width: 100%; justify-content: center;",
           body =
-            case Disabled of
-              true -> [];
-              _ ->
-                [ Input,
+            [ Input,
+              case Disabled of
+                true -> [];
+                _ ->
                   #panel{
                     id = form:atom([InputId, "form"]),
                     class = ['dropdown-content'],
                     body = #panel{class = ['dropdown-item'], body = Form}
-                  }] end }
+                  } end ]}
         ]}).