Skip to content

Commit 3f5403a

Browse files
authored
fix(ui): prevents hasMany text going outside of input boundaries (#7455)
## Description V2 PR [here](#7454) `Before`: ![Screenshot 2024-07-31 at 12 40 50 PM](https://github.com/user-attachments/assets/ce61f4fc-e676-4273-aa4c-72610cb459b3) `After`: ![Screenshot 2024-07-31 at 12 40 23 PM](https://github.com/user-attachments/assets/d92631eb-28fb-46ca-bc23-46c7916bba34) - [x] I have read and understand the [CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md) document in this repository. ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) ## Checklist: - [x] Existing test suite passes locally with my changes
1 parent 62666a9 commit 3f5403a

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

packages/db-sqlite/src/schema/createIndex.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { AnySQLiteColumn} from 'drizzle-orm/sqlite-core';
1+
import type { AnySQLiteColumn } from 'drizzle-orm/sqlite-core'
22

33
import { index, uniqueIndex } from 'drizzle-orm/sqlite-core'
44

packages/next/src/views/Login/LoginField/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ export const LoginField: React.FC<LoginFieldProps> = ({ type, required = true })
4747
validate={(value, options) => {
4848
const passesUsername = username(
4949
value,
50-
options as ValidateOptions<any, { email?: string }, any, string>,
50+
options,
5151
)
5252
const passesEmail = email(
5353
value,
54-
options as ValidateOptions<any, { username?: string }, any, string>,
54+
options,
5555
)
5656

5757
if (!passesEmail && !passesUsername) {

packages/ui/src/elements/ReactSelect/ValueContainer/index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
}
2222

2323
&--is-multi {
24-
width: calc(100% + base(0.5));
24+
width: calc(100% + base(0.25));
2525

2626
&.rs__value-container--has-value {
2727
padding: 0;

packages/ui/src/fields/Text/index.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
}
1111
}
1212

13+
.has-many {
14+
.rs__input-container {
15+
overflow: hidden;
16+
}
17+
}
18+
1319
html[data-theme='light'] {
1420
.field-type.text {
1521
&.error {

test/hooks/collections/Hook/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ const Hooks: CollectionConfig = {
1212
hooks: {
1313
beforeOperation: [
1414
({ operation, req }) => {
15-
if (typeof req.payload.db.beginTransaction === 'function' && !req.transactionID && ['create', 'delete', 'update'].includes(operation)) {
15+
if (
16+
typeof req.payload.db.beginTransaction === 'function' &&
17+
!req.transactionID &&
18+
['create', 'delete', 'update'].includes(operation)
19+
) {
1620
throw new Error('transactionID is missing in beforeOperation hook')
1721
}
1822
},

0 commit comments

Comments
 (0)