bug优化
This commit is contained in:
@@ -118,6 +118,11 @@ export struct ChatP2PPage {
|
||||
navBarHeight: number = 80;
|
||||
// 底部输入框以及固定按钮操作栏高度
|
||||
@Local bottomHeight: number = 65;
|
||||
@Monitor("bottomHeight")
|
||||
onbottomHeightChange(monitor: IMonitor) {
|
||||
// console.info(`name change from ${monitor.value()?.before} to ${monitor.value()?.now}`);
|
||||
this.computeScrollHeight()
|
||||
}
|
||||
@Local bottomMargin: number = 100;
|
||||
// bottomMargin: number = 10;
|
||||
bottomWithReplyHeight: number = 135;
|
||||
@@ -932,8 +937,8 @@ export struct ChatP2PPage {
|
||||
this.clearInput(true)
|
||||
},
|
||||
onChangeInputHeight:(height:number)=> {
|
||||
this.bottomHeight = height+10
|
||||
this.computeScrollHeight()
|
||||
this.bottomHeight = height+25
|
||||
// this.computeScrollHeight()
|
||||
},
|
||||
inputStyle: this.inputStyle
|
||||
}).alignRules({
|
||||
|
||||
@@ -104,8 +104,8 @@ export struct NEChatInputView {
|
||||
if (this.inputContentLength === 0) {
|
||||
return baseHeight;
|
||||
}
|
||||
// 根据内容长度估算行数,假设每行约20个字符
|
||||
const estimatedLines = Math.ceil(this.inputContentLength / 20);
|
||||
// 根据内容长度估算行数,假设每行约4420个字符
|
||||
const estimatedLines = Math.ceil(this.inputContentLength / 26);
|
||||
const calculatedHeight = baseHeight + (estimatedLines - 1) * lineHeight;
|
||||
// 限制在最小和最大高度之间
|
||||
return Math.max(baseHeight, Math.min(calculatedHeight, maxHeight));
|
||||
|
||||
Reference in New Issue
Block a user