From 1f223d8e4c2c0e5ef48ca685472e64a119275d25 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Mon, 13 Feb 2017 11:55:12 +0800 Subject: [PATCH] fix: disabled option are not selectable, close: #4699 --- components/cascader/demo/search.md | 4 ++++ components/cascader/index.tsx | 1 + 2 files changed, 5 insertions(+) diff --git a/components/cascader/demo/search.md b/components/cascader/demo/search.md index a571d42e07..0c3048b39f 100644 --- a/components/cascader/demo/search.md +++ b/components/cascader/demo/search.md @@ -25,6 +25,10 @@ const options = [{ children: [{ value: 'xihu', label: 'West Lake', + }, { + value: 'xiasha', + label: 'Xia Sha', + disabled: true, }], }], }, { diff --git a/components/cascader/index.tsx b/components/cascader/index.tsx index 4dd5be2f13..60048dd9c9 100644 --- a/components/cascader/index.tsx +++ b/components/cascader/index.tsx @@ -239,6 +239,7 @@ export default class Cascader extends React.Component { path, label: render(inputValue, path, prefixCls), value: path.map(o => o.value), + disabled: path.some(o => o.disabled), }; }); }