Bug fixing

This commit is contained in:
anoshenko 2024-05-29 15:31:58 +03:00
parent 5edeca2286
commit a9877d99b8
6 changed files with 19 additions and 12 deletions

View File

@ -170,7 +170,7 @@ func (picker *colorPickerData) htmlProperties(self View, buffer *strings.Builder
buffer.WriteString(` onclick="stopEventPropagation(this, event)"`) buffer.WriteString(` onclick="stopEventPropagation(this, event)"`)
} }
picker.dataListHtmlProperies(picker, buffer) picker.dataListHtmlProperties(picker, buffer)
} }
func (picker *colorPickerData) handleCommand(self View, command string, data DataObject) bool { func (picker *colorPickerData) handleCommand(self View, command string, data DataObject) bool {

View File

@ -88,7 +88,7 @@ func (list *dataList) dataListItemsHtml(buffer *strings.Builder) {
} }
} }
func (list *dataList) dataListHtmlProperies(view View, buffer *strings.Builder) { func (list *dataList) dataListHtmlProperties(view View, buffer *strings.Builder) {
if len(list.dataList) > 0 { if len(list.dataList) > 0 {
buffer.WriteString(` list="`) buffer.WriteString(` list="`)
buffer.WriteString(list.dataListID(view)) buffer.WriteString(list.dataListID(view))

View File

@ -320,7 +320,7 @@ func (picker *datePickerData) htmlProperties(self View, buffer *strings.Builder)
buffer.WriteString(` onclick="stopEventPropagation(this, event)"`) buffer.WriteString(` onclick="stopEventPropagation(this, event)"`)
} }
picker.dataListHtmlProperies(picker, buffer) picker.dataListHtmlProperties(picker, buffer)
} }
func (picker *datePickerData) handleCommand(self View, command string, data DataObject) bool { func (picker *datePickerData) handleCommand(self View, command string, data DataObject) bool {

View File

@ -211,8 +211,8 @@ func (edit *editViewData) set(tag string, value any) bool {
switch tag { switch tag {
case Text: case Text:
oldText := GetText(edit)
if text, ok := value.(string); ok { if text, ok := value.(string); ok {
oldText := GetText(edit)
edit.properties[Text] = text edit.properties[Text] = text
if text = GetText(edit); oldText != text { if text = GetText(edit); oldText != text {
edit.textChanged(text, oldText) edit.textChanged(text, oldText)
@ -225,8 +225,8 @@ func (edit *editViewData) set(tag string, value any) bool {
return false return false
case Hint: case Hint:
oldText := GetHint(edit)
if text, ok := value.(string); ok { if text, ok := value.(string); ok {
oldText := GetHint(edit)
edit.properties[Hint] = text edit.properties[Hint] = text
if text = GetHint(edit); oldText != text { if text = GetHint(edit); oldText != text {
if edit.created { if edit.created {
@ -400,6 +400,11 @@ func (edit *editViewData) htmlTag() string {
} }
func (edit *editViewData) htmlSubviews(self View, buffer *strings.Builder) { func (edit *editViewData) htmlSubviews(self View, buffer *strings.Builder) {
if GetEditViewType(edit) == MultiLineText {
if text := GetText(edit); text != "" {
buffer.WriteString(text)
}
}
edit.dataListHtmlSubviews(self, buffer) edit.dataListHtmlSubviews(self, buffer)
} }
@ -477,13 +482,15 @@ func (edit *editViewData) htmlProperties(self View, buffer *strings.Builder) {
buffer.WriteByte('"') buffer.WriteByte('"')
} }
if text := GetText(edit); text != "" { if editType != MultiLineText {
buffer.WriteString(` value="`) if text := GetText(edit); text != "" {
buffer.WriteString(convertText(text)) buffer.WriteString(` value="`)
buffer.WriteByte('"') buffer.WriteString(convertText(text))
buffer.WriteByte('"')
}
} }
edit.dataListHtmlProperies(edit, buffer) edit.dataListHtmlProperties(edit, buffer)
} }
func (edit *editViewData) handleCommand(self View, command string, data DataObject) bool { func (edit *editViewData) handleCommand(self View, command string, data DataObject) bool {

View File

@ -269,7 +269,7 @@ func (picker *numberPickerData) htmlProperties(self View, buffer *strings.Builde
buffer.WriteString(` oninput="editViewInputEvent(this)"`) buffer.WriteString(` oninput="editViewInputEvent(this)"`)
picker.dataListHtmlProperies(picker, buffer) picker.dataListHtmlProperties(picker, buffer)
} }
func (picker *numberPickerData) handleCommand(self View, command string, data DataObject) bool { func (picker *numberPickerData) handleCommand(self View, command string, data DataObject) bool {

View File

@ -308,7 +308,7 @@ func (picker *timePickerData) htmlProperties(self View, buffer *strings.Builder)
buffer.WriteString(` onclick="stopEventPropagation(this, event)"`) buffer.WriteString(` onclick="stopEventPropagation(this, event)"`)
} }
picker.dataListHtmlProperies(picker, buffer) picker.dataListHtmlProperties(picker, buffer)
} }
func (picker *timePickerData) handleCommand(self View, command string, data DataObject) bool { func (picker *timePickerData) handleCommand(self View, command string, data DataObject) bool {