Skip to content

tooltipProps given to buttonProps in MessageBarProps are ignored #536

@TamiTakamiya

Description

@TamiTakamiya

I wanted to control the parent element of tooltip for send/stop button because we are using PF chatbot in an iframe. Initially I implemented

              <MessageBar
                  onSendMessage={handleSend}
                  hasAttachButton={false}
                  hasStopButton={hasStopButton}
                  handleStopButton={handleStopButton}
                  buttonProps={{
                    send: {
                      tooltipProps: { appendTo: bodyElement },
                    },
                    stop: {
                      tooltipProps: { appendTo: bodyElement },
                    },
                  }}
                />    

and found it did not work. I looked at MessageBar.tsx and found that buttonProps?.send?.tooltipProps was not used while buttonProps?.send?.tooltipContent was.

I could workaround the issue by modifying the code to

                <MessageBar
                  onSendMessage={handleSend}
                  hasAttachButton={false}
                  hasStopButton={hasStopButton}
                  handleStopButton={handleStopButton}
                  buttonProps={{
                    send: {
                      //@ts-ignore
                      props: { tooltipProps: { appendTo: bodyElement } },
                    },
                    stop: {
                      //@ts-ignore
                      props: { tooltipProps: { appendTo: bodyElement } },
                    },
                  }}
                />

but I'd like to get rid of the use of @ts-ignore. Thanks.

Metadata

Metadata

Assignees

Labels

PF6Applies to only the PF6 version

Type

No fields configured for Bug.

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions