mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: text update bug on number/url fields (#5315)
This commit is contained in:
parent
8273d66c50
commit
027ab2c1ef
@ -163,19 +163,18 @@ class _TextCellState extends State<TextCardCell> {
|
|||||||
return BlocBuilder<TextCellBloc, TextCellState>(
|
return BlocBuilder<TextCellBloc, TextCellState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
final content = state.content;
|
final content = state.content;
|
||||||
final text = content.isEmpty
|
|
||||||
? LocaleKeys.grid_row_textPlaceholder.tr()
|
|
||||||
: content;
|
|
||||||
final color = content.isEmpty ? Theme.of(context).hintColor : null;
|
|
||||||
|
|
||||||
return Padding(
|
return content.isEmpty
|
||||||
padding: widget.style.padding,
|
? const SizedBox.shrink()
|
||||||
child: Text(
|
: Container(
|
||||||
text,
|
padding: widget.style.padding,
|
||||||
style: widget.style.textStyle.copyWith(color: color),
|
alignment: AlignmentDirectional.centerStart,
|
||||||
maxLines: widget.style.maxLines,
|
child: Text(
|
||||||
),
|
content,
|
||||||
);
|
style: widget.style.textStyle,
|
||||||
|
maxLines: widget.style.maxLines,
|
||||||
|
),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -79,8 +79,11 @@ class _NumberCellState extends GridEditableTextCell<EditableNumberCell> {
|
|||||||
return BlocProvider.value(
|
return BlocProvider.value(
|
||||||
value: cellBloc,
|
value: cellBloc,
|
||||||
child: BlocListener<NumberCellBloc, NumberCellState>(
|
child: BlocListener<NumberCellBloc, NumberCellState>(
|
||||||
listener: (context, state) =>
|
listener: (context, state) {
|
||||||
_textEditingController.text = state.content,
|
if (!focusNode.hasFocus) {
|
||||||
|
_textEditingController.text = state.content;
|
||||||
|
}
|
||||||
|
},
|
||||||
child: Builder(
|
child: Builder(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return widget.skin.build(
|
return widget.skin.build(
|
||||||
|
@ -112,8 +112,10 @@ class _GridURLCellState extends GridEditableTextCell<EditableURLCell> {
|
|||||||
child: BlocListener<URLCellBloc, URLCellState>(
|
child: BlocListener<URLCellBloc, URLCellState>(
|
||||||
listenWhen: (previous, current) => previous.content != current.content,
|
listenWhen: (previous, current) => previous.content != current.content,
|
||||||
listener: (context, state) {
|
listener: (context, state) {
|
||||||
_textEditingController.value =
|
if (!focusNode.hasFocus) {
|
||||||
_textEditingController.value.copyWith(text: state.content);
|
_textEditingController.value =
|
||||||
|
_textEditingController.value.copyWith(text: state.content);
|
||||||
|
}
|
||||||
widget._cellDataNotifier.value = state.content;
|
widget._cellDataNotifier.value = state.content;
|
||||||
},
|
},
|
||||||
child: widget.skin.build(
|
child: widget.skin.build(
|
||||||
|
Loading…
Reference in New Issue
Block a user