-
-
Notifications
You must be signed in to change notification settings - Fork 47.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support notification pop up from topLeft or bottomRight or bottomLeft #4700
support notification pop up from topLeft or bottomRight or bottomLeft #4700
Conversation
@ystarlongzi, thanks for your PR! By analyzing the history of the files in this pull request, we identified @afc163, @yesmeck and @yiminghe to be potential reviewers. |
Coverage decreased (-0.9%) to 76.228% when pulling d11c942a3402fa4326e64603a7dd7723b2a24d70 on ystarlongzi:notification-placement into 70188ae on ant-design:feature-2.7. |
|
@@ -22,8 +22,9 @@ exports[`test renders ./components/auto-complete/demo/antd.md correctly 1`] = ` | |||
class="ant-select-search ant-select-search--inline"> | |||
<div | |||
class="ant-select-search__field__wrap"> | |||
<textarea | |||
class="ant-input ant-select-search__field" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里不应该修改。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
snapshots 是在运行 npm test -- -u
后生成的
非 notification 目录下的 snapshot 不应该有改动。你本地 node_modules 恐怕不是最新的。 |
确实不是最新的,我再运行下命令。👍 |
Coverage decreased (-0.9%) to 76.228% when pulling 53d3d4615b9929a735b3a1208f956af36891769a on ystarlongzi:notification-placement into 70188ae on ant-design:feature-2.7. |
再 rebase 一下,steps 也不应该有改动。:sweat_smile: |
onChange={val => { | ||
notification.config({ | ||
placement: val, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没对齐。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,我调整下。
const openNotification = () => { | ||
notification.open({ | ||
message: 'Notification Title', | ||
description: 'This is the content of the notification. This is the content of the notification. This is the content of the notification.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
open 这里也支持一下 placement
如何?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,我也加下。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@afc163
在实现上支持 placement
,然后 demo 里的 open
方法内就不用体现 placement
了吧,因为 demo 里是通过 config
方法修改 placement
。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那文档里补充一下。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯嗯,好的。
{val} | ||
</Option> | ||
); | ||
})} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{options.map(val => <Option key={val}>{val}</Option>)}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,我调整下。
rebase 一下,最好不要出现 |
Coverage decreased (-1.04%) to 76.05% when pulling b1855d5850ba828696c36d693a2aa206e7de1085 on ystarlongzi:notification-placement into f4e887b on ant-design:feature-2.7. |
还有,补一下用例吧,真是辛苦了。。 |
嗯嗯,好的,我也研究下 rebase 的用法。 |
@ystarlongzi 节前有时间完成么?春节前我们要发 2.7 ~ |
@afc163 |
然后如果冲突了。用
|
空了可以看下 pro git 之类的书籍。 |
2. update doc 3. support `placement` arguments in `open` method
| top | 消息距离顶部的位置 | Number | 24px | | ||
| placement | 弹出位置,可选 `topLeft` `topRight` `bottomLeft` `bottomRight` | string | topRight | | ||
| top | 消息从顶部弹出时,距离顶部的位置 | Number | 24px | | ||
| bottom | 消息从底部弹出时,距离底部的位置 | Number | 24px | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
number
小写,默认值是 24px
还是 24
?如果是 24px
的话那应该是 string
。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是 24
,我调整下。
closed #4531
@afc163 @benjycui 调整涉及到的内容如下:
tooltip
,引入了placement
接口,可以在四个方位弹出消息bottom
接口,控制消息距离浏览器底部的距离