mirror of https://github.com/anoshenko/rui.git
Bug fixing
This commit is contained in:
parent
b1628023f7
commit
fd516af017
|
@ -41,12 +41,14 @@ div:focus {
|
|||
*/
|
||||
|
||||
input {
|
||||
box-sizing: border-box;
|
||||
margin: 2px;
|
||||
padding: 1px;
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
select {
|
||||
box-sizing: border-box;
|
||||
margin: 2px;
|
||||
font-size: inherit;
|
||||
}
|
||||
|
@ -56,6 +58,7 @@ button {
|
|||
}
|
||||
|
||||
textarea {
|
||||
box-sizing: border-box;
|
||||
margin: 2px;
|
||||
padding: 4px;
|
||||
overflow: auto;
|
||||
|
|
15
editView.go
15
editView.go
|
@ -208,13 +208,9 @@ func (edit *editViewData) set(tag string, value any) bool {
|
|||
if text = GetText(edit); oldText != text {
|
||||
edit.textChanged(text, oldText)
|
||||
if edit.created {
|
||||
if GetEditViewType(edit) == MultiLineText {
|
||||
updateInnerHTML(edit.htmlID(), edit.Session())
|
||||
} else {
|
||||
edit.session.callFunc("setInputValue", edit.htmlID(), text)
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
@ -442,6 +438,9 @@ func (edit *editViewData) htmlProperties(self View, buffer *strings.Builder) {
|
|||
if strings.ContainsRune(text, '"') {
|
||||
text = strings.ReplaceAll(text, `"`, `"`)
|
||||
}
|
||||
if strings.ContainsRune(text, '\n') {
|
||||
text = strings.ReplaceAll(text, "\n", `\n`)
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
|
@ -458,20 +457,12 @@ func (edit *editViewData) htmlProperties(self View, buffer *strings.Builder) {
|
|||
buffer.WriteByte('"')
|
||||
}
|
||||
|
||||
if editType != MultiLineText {
|
||||
if text := GetText(edit); text != "" {
|
||||
buffer.WriteString(` value="`)
|
||||
buffer.WriteString(convertText(text))
|
||||
buffer.WriteByte('"')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (edit *editViewData) htmlSubviews(self View, buffer *strings.Builder) {
|
||||
if GetEditViewType(edit) == MultiLineText {
|
||||
buffer.WriteString(GetText(edit))
|
||||
}
|
||||
}
|
||||
|
||||
func (edit *editViewData) handleCommand(self View, command string, data DataObject) bool {
|
||||
switch command {
|
||||
|
|
Loading…
Reference in New Issue