mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-07-06 01:41:48 +02:00
#116 - Fix for not showing the -1 limit on inputs
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
- [#114](https://github.com/estruyf/vscode-front-matter/issues/114): Fix for categories/tags provided as string in YAML
|
||||
- [#115](https://github.com/estruyf/vscode-front-matter/issues/115): Fix for updating added categories/tags
|
||||
- [#116](https://github.com/estruyf/vscode-front-matter/issues/116): Fix for not showing the `-1` limit on inputs
|
||||
|
||||
## [4.0.0] - 2021-09-22 - [Release Notes](https://beta.frontmatter.codes/updates/v4_0_0)
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ export const TextField: React.FunctionComponent<ITextFieldProps> = ({limit, labe
|
||||
|
||||
let isValid = true;
|
||||
if (limit && limit !== -1) {
|
||||
isValid = ((text || "").length < limit);
|
||||
isValid = ((text || "").length <= limit);
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -46,7 +46,7 @@ export const TextField: React.FunctionComponent<ITextFieldProps> = ({limit, labe
|
||||
}} />
|
||||
|
||||
{
|
||||
limit && (text || "").length >= limit && (
|
||||
limit && limit > 0 && (text || "").length > limit && (
|
||||
<div className={`metadata_field__limit`}>
|
||||
Field limit reached {(text || "").length}/{limit}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user