mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-16 09:36:17 +08:00
fix(editor): add placeholder for input of database context menu (#11079)
fix: BS-2594
This commit is contained in:
@@ -109,7 +109,7 @@ export class DatabaseBlockComponent extends CaptionedBlockComponent<DatabaseBloc
|
||||
items: [
|
||||
menu.input({
|
||||
initialValue: this.model.props.title.toString(),
|
||||
placeholder: 'Untitled',
|
||||
placeholder: 'Database title',
|
||||
onChange: text => {
|
||||
this.model.props.title.replace(
|
||||
0,
|
||||
|
||||
@@ -110,6 +110,7 @@ export class MenuInput extends MenuFocusable {
|
||||
this.menu.setFocusOnly(this);
|
||||
}}"
|
||||
@input="${this.onInput}"
|
||||
placeholder="${this.data.placeholder ?? ''}"
|
||||
@keydown="${this.onKeydown}"
|
||||
@copy="${this.stopPropagation}"
|
||||
@paste="${this.stopPropagation}"
|
||||
|
||||
@@ -204,7 +204,7 @@ export class MenuComponent
|
||||
}
|
||||
return html`
|
||||
<div
|
||||
style="display:flex;align-items:center;gap: 4px;min-width: 300px;padding:3px 4px 3px 2px"
|
||||
style="display:flex;align-items:center;gap: 4px;padding:3px 4px 3px 2px"
|
||||
@mouseenter="${() => this.menu.closeSubMenu()}"
|
||||
>
|
||||
${title.onBack
|
||||
|
||||
@@ -14,6 +14,7 @@ export const inputConfig = (property: Property) => {
|
||||
</div>
|
||||
`,
|
||||
initialValue: property.name$.value,
|
||||
placeholder: 'Property name',
|
||||
onChange: text => {
|
||||
property.nameSet(text);
|
||||
},
|
||||
@@ -26,6 +27,7 @@ export const inputConfig = (property: Property) => {
|
||||
</div>
|
||||
`,
|
||||
initialValue: property.name$.value,
|
||||
placeholder: 'Property name',
|
||||
onComplete: text => {
|
||||
property.nameSet(text);
|
||||
},
|
||||
|
||||
+1
@@ -236,6 +236,7 @@ export const popViewOptions = (
|
||||
items.push(
|
||||
menu.input({
|
||||
initialValue: view.name$.value,
|
||||
placeholder: 'View name',
|
||||
onChange: text => {
|
||||
view.nameSet(text);
|
||||
},
|
||||
|
||||
@@ -164,6 +164,7 @@ export class DataViewHeaderViews extends WidgetBase {
|
||||
items: [
|
||||
menu.input({
|
||||
initialValue: view.name$.value,
|
||||
placeholder: 'View name',
|
||||
onChange: text => {
|
||||
view.nameSet(text);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user