Skip to content

Commit 349cd68

Browse files
Merge branch 'neolution-ch:main' into main
2 parents a2108d9 + 007ee1e commit 349cd68

4 files changed

Lines changed: 14 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [3.15.1] - 2026-01-12
11+
12+
### Fix
13+
14+
- `*` visibility on a required field label, whether the label is empty.
15+
- `DatePickerInput` selector when `onClickOutside` function is triggered.
16+
1017
## [3.15.0] - 2025-12-19
1118

1219
### Added
@@ -684,7 +691,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
684691

685692
- Created package :tada:
686693

687-
[unreleased]: https://github.com/neolution-ch/react-hook-form-components/compare/3.15.0...HEAD
694+
[unreleased]: https://github.com/neolution-ch/react-hook-form-components/compare/3.15.1...HEAD
688695
[0.1.2]: https://github.com/neolution-ch/react-hook-form-components/compare/0.1.1...0.1.2
689696
[0.1.1]: https://github.com/neolution-ch/react-hook-form-components/compare/0.1.0...0.1.1
690697
[0.1.0]: https://github.com/neolution-ch/react-hook-form-components/releases/tag/0.1.0
@@ -709,6 +716,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
709716
[0.4.0]: https://github.com/neolution-ch/react-hook-form-components/compare/0.3.0...0.4.0
710717
[0.3.0]: https://github.com/neolution-ch/react-hook-form-components/compare/0.2.0...0.3.0
711718
[0.2.0]: https://github.com/neolution-ch/react-hook-form-components/releases/tag/0.2.0
719+
[3.15.1]: https://github.com/neolution-ch/react-hook-form-components/compare/3.15.0...3.15.1
712720
[3.15.0]: https://github.com/neolution-ch/react-hook-form-components/compare/3.14.0...3.15.0
713721
[3.14.0]: https://github.com/neolution-ch/react-hook-form-components/compare/3.13.1...3.14.0
714722
[3.13.1]: https://github.com/neolution-ch/react-hook-form-components/compare/3.13.0...3.13.1

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@neolution-ch/react-hook-form-components",
3-
"version": "3.15.0",
3+
"version": "3.15.1",
44
"description": "a collection of react hook form components to reduce boilerplate and figuring out how to integrate react hook form with other libraries",
55
"homepage": "https://neolution-ch.github.io/react-hook-form-components",
66
"repository": {

src/lib/DatePickerInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ const DatePickerInput = <T extends FieldValues>(props: DatePickerInputProps<T>)
181181
field.onChange(convertedDate);
182182
}}
183183
onClickOutside={(e) => {
184-
if (document.querySelector(`#${formGroupId.current}`)?.contains(e.target as HTMLElement) && !disabled && !formDisabled) {
184+
if (document.getElementById(formGroupId.current)?.contains(e.target as HTMLElement) && !disabled && !formDisabled) {
185185
internalDatePickerRef.current?.setOpen(true);
186186
}
187187

src/lib/helpers/form.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ReactNode } from "react";
22
import { FieldPath, FieldValues } from "react-hook-form";
33
import { RequiredFieldPath } from "../types/Form";
4+
import { isNullOrWhitespace } from "@neolution-ch/javascript-utils";
45

56
const matchesWildcard = (rule: string, pathParts: string[]) => {
67
const ruleParts = rule.split(".");
@@ -20,6 +21,7 @@ const getRequiredLabel = <T extends FieldValues>(
2021
label: ReactNode,
2122
fieldPath: FieldPath<T>,
2223
requiredFields?: RequiredFieldPath<T>[],
23-
): ReactNode => (typeof label === "string" ? (isRequiredField(fieldPath, requiredFields) ? `${String(label)} *` : label) : label);
24+
): ReactNode =>
25+
typeof label === "string" && !isNullOrWhitespace(label) && isRequiredField(fieldPath, requiredFields) ? `${label} *` : label;
2426

2527
export { getRequiredLabel, isRequiredField };

0 commit comments

Comments
 (0)