forked from mbk-lab/rui_orig
Bug fixing
This commit is contained in:
parent
5b545acbd1
commit
b43bf80856
13
editView.go
13
editView.go
|
@ -491,23 +491,30 @@ func (edit *editViewData) htmlProperties(self View, buffer *strings.Builder) {
|
||||||
buffer.WriteByte('"')
|
buffer.WriteByte('"')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
convertText := func(text string) string {
|
||||||
|
if strings.ContainsRune(text, '"') {
|
||||||
|
text = strings.ReplaceAll(text, `"`, `"`)
|
||||||
|
}
|
||||||
|
return textToJS(text)
|
||||||
|
}
|
||||||
|
|
||||||
if hint := GetHint(edit, ""); hint != "" {
|
if hint := GetHint(edit, ""); hint != "" {
|
||||||
buffer.WriteString(` placeholder="`)
|
buffer.WriteString(` placeholder="`)
|
||||||
buffer.WriteString(textToJS(hint))
|
buffer.WriteString(convertText(hint))
|
||||||
buffer.WriteByte('"')
|
buffer.WriteByte('"')
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer.WriteString(` oninput="editViewInputEvent(this)"`)
|
buffer.WriteString(` oninput="editViewInputEvent(this)"`)
|
||||||
if pattern := GetEditViewPattern(edit, ""); pattern != "" {
|
if pattern := GetEditViewPattern(edit, ""); pattern != "" {
|
||||||
buffer.WriteString(` pattern="`)
|
buffer.WriteString(` pattern="`)
|
||||||
buffer.WriteString(textToJS(pattern))
|
buffer.WriteString(convertText(pattern))
|
||||||
buffer.WriteByte('"')
|
buffer.WriteByte('"')
|
||||||
}
|
}
|
||||||
|
|
||||||
if editType != MultiLineText {
|
if editType != MultiLineText {
|
||||||
if text := GetText(edit, ""); text != "" {
|
if text := GetText(edit, ""); text != "" {
|
||||||
buffer.WriteString(` value="`)
|
buffer.WriteString(` value="`)
|
||||||
buffer.WriteString(textToJS(text))
|
buffer.WriteString(convertText(text))
|
||||||
buffer.WriteByte('"')
|
buffer.WriteByte('"')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -251,7 +251,7 @@ func (tabsLayout *tabsLayoutData) set(tag string, value interface{}) bool {
|
||||||
updateInnerHTML(htmlID, tabsLayout.session)
|
updateInnerHTML(htmlID, tabsLayout.session)
|
||||||
}
|
}
|
||||||
|
|
||||||
case TabStyle, CurrentTabStyle:
|
case TabStyle, CurrentTabStyle, TabBarStyle:
|
||||||
if text, ok := value.(string); ok {
|
if text, ok := value.(string); ok {
|
||||||
if text == "" {
|
if text == "" {
|
||||||
delete(tabsLayout.properties, tag)
|
delete(tabsLayout.properties, tag)
|
||||||
|
|
Loading…
Reference in New Issue