Skip to content

Commit

Permalink
dropdown "set value" not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Mar 6, 2025
1 parent 5f11c10 commit 4ba984f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Form/Control/Lookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ protected function init(): void
});
}

#[\Override]
public function getValue()
{
return $this->entityField !== null
? $this->getApp()->uiPersistence->typecastAttributeSaveField($this->entityField->getField(), $this->entityField->get())
: ($this->content ?? '');
}

/**
* @param bool|string $when
* @param JsExpressionable $action
Expand Down Expand Up @@ -400,7 +408,7 @@ protected function renderView(): void
$entity = $this->model->loadBy($idField, $this->entityField->get());

$row = $this->renderRow($entity);
$jsChain->dropdown('set value', $row['value'], true)->dropdown('set text', $row['title'], true);
$jsChain->dropdown('set text', $row['title'], true);
}

$this->js(true, $jsChain);
Expand Down

0 comments on commit 4ba984f

Please sign in to comment.