Skip to content

Commit

Permalink
should handle textarea split into array
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Joseph Petro committed Dec 25, 2024
1 parent 2a739bc commit ba8f133
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion smart-view/adapters/_adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export class SmartViewAdapter {
const smart_setting = new this.setting_class(elm);
smart_setting.addTextArea(textarea => {
textarea.setPlaceholder(elm.dataset.placeholder || "");
textarea.setValue(value || "");
textarea.setValue(Array.isArray(value) ? value.join("\n") : value || "");
let debounceTimer;
textarea.onChange(async (value) => {
value = value.split("\n").map(v => v.trim()).filter(v => v);
Expand Down

0 comments on commit ba8f133

Please sign in to comment.