#116 - Fix for not showing the -1 limit on inputs

This commit is contained in:
Elio Struyf
2021-09-24 10:27:49 +02:00
parent d8bffdcf6c
commit b8f5e10f4b
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -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>