question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Input Text] Proposal to add custom props to the suggestions button

See original GitHub issue

Expected Behavior

I want to propose adding the ability to pass props to the suggestions button that exists in the InputText component. I wanted to add some attributes to the button or even be able to customize the button based on my existing custom theme for example. I could do it with javascript but wouldn’t be the best way 😃

Actual Behavior

As far as I saw, currently, it’s not possible to customize the suggestions button props in the InputText component:

https://github.com/grommet/grommet/blob/316e802ed2a05f71344977f6b3eb0f7283f30e5d/src/js/components/TextInput/TextInput.js#L370-L391

URL, screen shot, or Codepen exhibiting the issue

image

Does that make sense? If so, I’m happy to open a PR doing that 🚀

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
rodrigoeacommented, Jul 7, 2022

@jcfilben thanks for your reply!

I use a tool that collects data for click events, and I want to track clicks in each item of the suggestion list by passing a custom data attribute to the buttons.

I managed to work around it by passing a custom label (similar to what you shared), this way the tool can capture the clicks 👍🏻 - It works for now!

Since I managed to work around it, I’m closing the issue 😄 - thanks!

0reactions
jcfilbencommented, Jul 5, 2022

We do allow custom suggestions, see this storybook example. However, I realize this method doesn’t let you edit the actual button but instead allows you to edit the content of the button. Can you share what you are trying to achieve that cannot be done without editing the button? I’m just trying to better understand the use case

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom input component in react native input is not working ...
Using typescript, import {TextInput, TextInputProps, View} from "react-native";. declare a props interface: interface Props extends ...
Read more >
How to customize the file upload button in React - Medium
The solution · Step 1: Make the input element invisible · Step 2: Add a button element that you style to your taste...
Read more >
How To Customize React Components with Props
In this tutorial, you'll create custom components by passing props to your component. Props are arguments that you provide to a JSX element....
Read more >
Use predictive text on iPhone - Apple Support
As you type text on the iPhone keyboard, Siri predicts your next word, based on your recent activity. Tap the word to enter...
Read more >
Hooks FAQ - React
Do Hooks replace render props and higher-order components? ... (If you find yourself doing this often, you could create a custom Hook for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found