Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

136
Views
Dynamically hide/show arrow button on input element of type number with Lit

How to dynamically show/hide arrow buttons on <input type="number"> with Lit?

Here is a solution on how to do this task statically (https://www.w3schools.com/howto/howto_css_hide_arrow_number.asp):

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type=number] {
  -moz-appearance: textfield;
}

I need to use a property and depending on its value either display or hide the arrow buttons. The following approach doesn't work in combination with a class:

@property({ type: Boolean }) hideNumberArrows = false
<input
  class="${this.hideNumberArrows ? 'my-class-name' : ''}"
/>
input.my-class-name::-webkit-outer-spin-button
input.my-class-name::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

Any suggestions?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!