Unsure why the React button is disappearing specifically on Safari iOS. Any thoughts on how CSS

Hey there! I created a small hamburger button for my website, but for some reason, it doesn't show up on Safari iOS. Interestingly, it works perfectly fine on Windows Chrome, Windows Firefox, and my Android device. I've been trying to troubleshoot this as a newbie in web development, but I haven't been able to figure it out. Do you have any idea what might be causing this issue?

Here's the code for the React component:

import React from "react";
import "./DrawerButton.css";

const drawerButton = (props: Props) => (
  <button onClick={props.onClick} className="drawer_button">
    <div className="drawer_button_line" />
    <div className="drawer_button_line" />
    <div className="drawer_button_line" />
  </button>
);

interface Props {
  onClick: () => void;
}

export default drawerButton;

And here's the CSS code:

.drawer_button {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    height: 24px;
    width: 23px;
    background: transparent;
    border: none;
    cursor: pointer;
    outline: none;
    padding: 0;
    box-sizing: border-box;
}

.drawer_button_line {
    width: 100%;
    height: 2px;
    background: white;
    border-radius: 3px;
}

Answer №1

To improve the appearance of your button, consider including the -webkit-appearance: none in your CSS. Without this property, Safari will show its unattractive default button style.

For more information on CSS appearance property, visit: https://developer.mozilla.org/en-US/docs/Web/CSS/appearance

Answer №2

To overcome any missing CSS styles, consider applying inline styles. Safari may retain default styles in its cache which could affect how your website is displayed.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to organize table rows into a single column when the window is resized?

I am working on a table that has three pictures in a row, with 100% width. I want the table to be responsive and stack the pictures into one column when the space is limited. The issue I am currently facing is that the elements of the table do not stack i ...

Utilizing AJAX to dynamically populate an HTML list from a database and then saving the user's newly selected value back to the database

I'm working on dynamically populating a list from a database using AJAX and then updating the selected value back to the database with a servlet. What's the best approach for achieving this? Typically, I use the following code for dynamic update ...

In React development, a div (button) is visible, but in the production build, it becomes hidden from

I have been working on a website for my job, and I have added a "Gallery" button on top of two slideshows. Everything works perfectly fine on the development build, but when it comes to the production build, the button doesn't show up for some reason. ...

Vertically center text in an email within a div using HTML

i'm struggling to perfectly center the text within a div in an HTML email. While it appears fine in Browserview with proper line-height, issues arise in Apple Mail and Outlook where it doesn't align vertically. <div style='width: 80%; ...

Update Table Row Background Color in Separate Table by Clicking Button Using JQuery

Two tables are involved in this scenario - one that receives dynamically added rows, and another that stores the data to be included. The illustration above displays these tables. Upon clicking the Edit button, the information from the selected row in Tab ...

submitting two contact forms using ajax

Looking to enhance my knowledge of form design... Hello there! I'm currently working with two contact forms on the same page, both utilizing ajax for submissions. Each form functions properly when standalone, but as soon as I integrate them togethe ...

The mapStateToProps value is one keystroke delayed compared to the getState() value

Currently, I am implementing redux's connect() method on my App.js file and then passing a dispatcher down to a child component. The child component also receives the state variable as a prop. The problem I am encountering is that when logging the st ...

Updating ES6 syntax for superset in array: a step-by-step guide

I am currently working with ES6 React code that generates an array of MiniIcons on a webpage. const MiniIcons = ({miniicons}) => ( <div id="application"> {miniicons.map(miniicon => ( <MiniIcon key={miniicon.id} id={miniicon.id} ...

What is the best way to determine the width and height of text within a TextArea using JavaScript in an HTML document

Imagine this scenario: https://i.stack.imgur.com/cliKE.png I am looking to determine the size of the red box within the textarea. Specifically, I want to measure the dimensions of the text itself, not the dimensions of the entire textarea. The HTML code ...

List formatted in a table

Can a list be inserted into a table using markdown? I attempted to research this but came up empty-handed. An example of a Table: Fruit |Color ---------|---------- Apples |Red Pears |Green and an example of a list: List item 1 List item 2 ...

What is the best way to organize a Xamarin library that includes both iOS and Android bindings?

My goal is to develop a library that can be utilized in Xamarin projects, incorporating both iOS and Android libraries (static lib & jar). To achieve this, I have devised a solution that includes an Android binding project and an iOS binding project. In o ...

What is the process for changing a Supabase user's password within a NextJs application?

Currently, I am encountering difficulties updating a password for a supabase user on a BlitzJs (NextJs) project. The process starts with sending an email containing a reset link. Upon clicking the link, the user is directed to a page where they can update ...

Round up all the hyperlinks within a paragraph and organize them neatly into a list

Let me present a scenario: <p class="links">Lorem <a href="#">diam</a> nonummy nibh <a href="#">Lorem</a></p> Following that, I have a lineup: <ul class="list"> </ul> How do I achieve this using jQuery? ...

How to extract hover CSS property from a Selenium WebElement using XPath in Python

Is there a way to detect if a button changes its background color on hover? I know how to get the cursor property: print webElement.value_of_css_property('cursor') But I am unsure how to capture the hover property. ...

Stopping autoplay in Swiper as soon as you hover over it

My swiper is set to autoplay, but I want it to stop immediately when hovered over instead of waiting for the transition to finish. Is there a way to interrupt the transition and stop it at the exact point where the cursor hovers? Here is my Swiper config ...

Creating unique appbars for different sections on my sidebar in ReactJs

I am trying to implement a responsive drawer and AppBar using material-ui (@material-ui/core). My goal is to display a specific AppBar for each section of the drawer. For instance, when the user navigates to the Timetable section, I want the AppBar label t ...

Print directly without the need for a preview or dialog box

Is there a way to easily print content with just one click, without having to go through the preview or print dialog box? Here is a snippet of my code: <head> <style type="text/css"> #printable { display: none; } @media print { #non-pr ...

The href link on Android and iPhone devices is not activating, instead showing a focus rectangle

I've encountered an issue with the responsive layout of my HTML5 site on Android and iPhone versions. The links on the site are behaving strangely - they only work if I hold them down for a full second. Otherwise, they act as if a hover event is trig ...

Tips for including a horizontal line beneath each heading in an HTML using just CSS

Is it possible to include a horizontal line following each heading without employing the <hr> tag? I am interested in accomplishing this solely within the parameters of the <style></style> tags. ...

Global Declaration of Third-Party Modules for Seamless Use without Imports in Webpack5 with TypeScript

Within my React project utilizing Webpack, I have opted to declare certain modules as global entities to eliminate the need for importing them every time they are needed. In my Webpack configuration file: plugins: [ new webpack.ProvidePlugin({ ...