Semantic-Org/Semantic-UI-React

Search: ability to pass Image props in SearchResult

開放

#3,619 建立於 2019年5月24日

 (4 則留言) (0 個反應) (0 位負責人)JavaScript (4,065 個分叉)batch import
enhancementhelp wanted

倉庫指標

星標
 (13,136 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Feature Request

Problem description

I wanted to use circular images in <Search> results. However, the image prop only accepts a string according to the documentation, not a props object.

I tried passing an object anyway { circular : true, src : 'https://...' } and it renders the image successfully. However, the image isn't circular, despite the fact that the circular class is correctly applied. The border-radius seems to be overridden by a selector with higher precedence. I then tried using a custom render function and had the same result.

Since the documentation doesn't indicate that props objects are supported here, maybe this is expected? But it's kind of surprising nonetheless.

Proposed solution

Officially support props object for image and fix any relevant CSS precedence issues.

MVP

https://codesandbox.io/s/semantic-ui-react-xce2z

貢獻者指南