Skip to content

Commit

Permalink
fix: placement cls
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed May 6, 2022
1 parent 0568651 commit 6a09160
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Notifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const Notifications = React.forwardRef<NotificationsRef, NotificationsProps>((pr
return (
<CSSMotionList
key={placement}
className={classNames(prefixCls, `${prefixCls}-topRight`)}
className={classNames(prefixCls, `${prefixCls}-${placement}`)}
style={style?.(placement)}
keys={keys}
motionAppear
Expand Down
12 changes: 12 additions & 0 deletions tests/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -492,4 +492,16 @@ describe('Notification.Basic', () => {
content: 'little',
});
});

it('placement', () => {
const { instance } = renderDemo();

act(() => {
instance.open({
placement: 'bottomLeft',
});
});

expect(document.querySelector('.rc-notification')).toHaveClass('rc-notification-bottomLeft');
});
});

1 comment on commit 6a09160

@vercel
Copy link

@vercel vercel bot commented on 6a09160 May 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.