forked from mbk-lab/rui_orig
2
0
Fork 0

Bug fixing

This commit is contained in:
Alexei Anoshenko 2022-05-26 12:01:49 +03:00
parent 5b545acbd1
commit b43bf80856
2 changed files with 11 additions and 4 deletions

View File

@ -491,23 +491,30 @@ func (edit *editViewData) htmlProperties(self View, buffer *strings.Builder) {
buffer.WriteByte('"')
}
convertText := func(text string) string {
if strings.ContainsRune(text, '"') {
text = strings.ReplaceAll(text, `"`, `"`)
}
return textToJS(text)
}
if hint := GetHint(edit, ""); hint != "" {
buffer.WriteString(` placeholder="`)
buffer.WriteString(textToJS(hint))
buffer.WriteString(convertText(hint))
buffer.WriteByte('"')
}
buffer.WriteString(` oninput="editViewInputEvent(this)"`)
if pattern := GetEditViewPattern(edit, ""); pattern != "" {
buffer.WriteString(` pattern="`)
buffer.WriteString(textToJS(pattern))
buffer.WriteString(convertText(pattern))
buffer.WriteByte('"')
}
if editType != MultiLineText {
if text := GetText(edit, ""); text != "" {
buffer.WriteString(` value="`)
buffer.WriteString(textToJS(text))
buffer.WriteString(convertText(text))
buffer.WriteByte('"')
}
}

View File

@ -251,7 +251,7 @@ func (tabsLayout *tabsLayoutData) set(tag string, value interface{}) bool {
updateInnerHTML(htmlID, tabsLayout.session)
}
case TabStyle, CurrentTabStyle:
case TabStyle, CurrentTabStyle, TabBarStyle:
if text, ok := value.(string); ok {
if text == "" {
delete(tabsLayout.properties, tag)