CMS Development

GLopez13
Participant

Be able to copy text from READONLY Input

SOLVE

Hello team,

Currently I am using an Input element (https://developers.hubspot.com/docs/reference/ui-components/standard-components/input) with the readonly property set as 'true' to display data in a private app. The 'problem' I am facing is I can NOT copy the text displayed in those Inputs. 

So I would like to ask you if you know if there is a way to be able to copy the displayed text? 

HINT: I cannot allow the user to "edit" those INPUTs.

Thank you very much in advance!

Regards,
Gabriel

0 Upvotes
1 Accepted solution
evaldas
Solution
Key Advisor | Platinum Partner
Key Advisor | Platinum Partner

Be able to copy text from READONLY Input

SOLVE

Hi @GLopez13,

 

That should be possible by default. Confirming that I am able to create a read-only input field, which allows me to copy the value from that field.

 

Example in Chrome, where I select the text from the read-only input and right-click to copy:

 

evaldas_0-1739933149248.png

 

The code used here is:

 

<Input
  label="Sample Field"
  name="samplefield"
  value="This is a Read-Only value"
  readOnly      
/>

 

Hope this helps!


✔️ Did this post help answer your query? Help the community by marking it as a solution.

View solution in original post

2 Replies 2
evaldas
Solution
Key Advisor | Platinum Partner
Key Advisor | Platinum Partner

Be able to copy text from READONLY Input

SOLVE

Hi @GLopez13,

 

That should be possible by default. Confirming that I am able to create a read-only input field, which allows me to copy the value from that field.

 

Example in Chrome, where I select the text from the read-only input and right-click to copy:

 

evaldas_0-1739933149248.png

 

The code used here is:

 

<Input
  label="Sample Field"
  name="samplefield"
  value="This is a Read-Only value"
  readOnly      
/>

 

Hope this helps!


✔️ Did this post help answer your query? Help the community by marking it as a solution.

kennedyp
Community Manager
Community Manager

Be able to copy text from READONLY Input

SOLVE

Hi @GLopez13! Welcome to the Community-- happy to have you here 😊

 

I want to invite some subject matter experts to see if they have any suggestions.

Hey @evaldas, @BarryGrennan, @GRajput do you have any thoughts on this?


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !