Why doesn't the keyUp event work in Swift?

I've trying to use the keyUp event in swift so then I can detect when the user presses a key and when the user releases the key.

I have the following code:

So shouldn't, when the guy is pressed and released, `foo` be printed to output log?

I can do this with the keyDown event:

and it works fine, just not for keyUp.

Is there something I'm doing wrong?

Have you tried overriding keyUp anywhere else to see if the problem just happens there?

Also, you don't have any local event monitors set up, do you? They might be accidentally intercepting and absorbing your key-up events. (If you don't know what I'm talking about, don't worry—there won't be any to worry about unless you set them up yourself.)

You might also try using a "tracking loop" your keyDown method by inserting a call to the window's nextEventMatchingMask(), looking for key-up events, and then responding to those. This link includes a discussion of tracking loops: (I know it's for mouse events, but the concepts are still valid)

https://developer.apple.com/library/prerelease/mac/documentation/Cocoa/Conceptual/EventOverview/HandlingMouseEvents/HandlingMouseEvents.html#//apple_ref/doc/uid/10000060i-CH6-SW18

No, I haven't tried overiding it anywhere so I will try that.

I didn't know what you were talking about so I assume I don't have any local event monitors set up 🙂

I'm not sure how to add the tracking loop. I'm afraid the examples were in Objective-C and I don't know that 😟

Could this be a bug in swift as I also asked on Stackoverflow here and someone said they were having the same issue where keyDown wouldn't work.

So I made a new Xcode project to test it out but now whenever I press a key it just makes the bong sound. Any idea why that might happen because I can't test if it happens on a brand new project with no other code at the moment becasue of that.

I should add that I'm using Xcode beta 4 version is it matters.

So I made a new Xcode project to test it out but now whenever I press a key it just makes the bong sound. Any idea why that might happen…

I'm not sure what's going on in your case but I tried this with a simple test project and it worked as expected. Here's what I did:

I created a Swift project from the Cocoa Application template.

I created a test view class as shown below.

I added an instance of this class to my nib and wired up a reference to it from my app delegate.

In my app delegate I called

I ran the app and pressed keys. Both "down" and "up" were printed.

It also beeped, but that's because I'm not handling the key events but rather passing them on to super.

The code worked the same on both Xcode 6.4 and Xcode 7.0b4, both running on 10.10.4.

Share and Enjoy — Quinn "The Eskimo!" Apple Developer Relations, Developer Technical Support, Core OS/Hardware

Hello eskimo 🙂

I did the following:

I put that in my view controller. Was that wrong to do? Because when I do it the down arrow key works but the up arrow key doesn't. But then if I do exactly the same thing in a new projet it doesn't work.

Did you notice that eskimo included the following method in his code?

Unless you include this one, then your view cannot respond to key events.

I added that and it made no differende. keyDown still works and keyUp still doesn't.

My ViewController looks like this:

down is printer to the log when I press a button but not up.

How is your view controller getting into the responder chain? I tried two ways of doing this, one of which replicated your results:

If I create a custom view, having accept first responder, and then make it the first responder, my view controller gets both key up and key down events.

If I add a text field to my view and click in that, the view controller gets key down events but not key up events.

At this point it's clear that this is definitely not related to Swift but rather something very specific to AppKit. I don't know AppKit (or any UI framework, for that matter) well enough to help you with anything beyond the basics. I've moved this thread to App Frameworks > Cocoa; hopefully someone more knowledgeable about this stuff will chime in over tehre.

Ok - thank you for your help.

I have a window contoller which is the initial controller and then this view is displayed first by the window controller.

On the view I have 2 web views, 5 custom views and one embeded view if that matters 🙂

As it turns out, I'm pretty good with AppKit. So which view are you having problems with?

I think that part of your problem may be that you're trying to handle events in your view controller , not your view. The view controller is supposed to manage the views and handle synchronization between the data storage and how it's displayed (a design pattern known as model-view-controller), not do the job of the views. Have you learned about the responder chain, a key mechanism in this interaction? Check it out in the documentation.

The view I'm having trouble with is the main one with everythign embededd into it.

I thought I coudl put that code in there then when they pressed a key it would call either the keyUp or keyDown function. When that function was called it woudl update some variabels then call one of the custom views (depending on the key that was pressed) to repaint.

Try clicking on different subviews to highlight them, and see if that affects the problem. The key events will actually go first to whatever's highlighted (aka the first responder ); only if the first responder ignores the event will it move up the chain to the superview. It seems that a subview is allowing the key-down events to move up the chain but is blocking the key-up events. Try adding a custom view to your superview with code like this to verify if that's the problem:

This code will manually pass the events up along the responder chain (see lines 10 and 14). Add it to your app, click it in the window to highlight it, then try pressing keys. It should pass both key-down and key-up events to the superview.

Ok, thank you so much now, it works now. But if it is ok, I would just like to check to make sure what I'm doing is the "correct" way so that I don't run into problems further down the line.

I have put the code inside the class above into the class of the first Custom View. The first custom view was would appear at the top if I dragged it onto the top of the other views. Is this what you means by the first responder?

Anyway, I put it into there then the code in the ViewController which was listening for keyDown and keyUp worked. Have I don't this correctly? Thanks again for yout help.

I'm not sure exactly what you're asking. But no, the first responder is not the topmost view—it's whatever's selected and highlighted in the window. Have you seen the blue "focus rings" around text fields, etc. to indicate that they're accepting input? That's the first responder.

Try by turning off the Full Keyboard Access in Accessibility system preferences / settings

safari keyup not working

Guiding Tech

We explain and teach technology, solve tech problems and help you make gadget buying decisions.

Top 12 Ways to Fix Safari Not Working on iPhone and iPad

Apple’s ingenious web browser, Safari, was developed in 2003 and received many praises. However, Google responded with Chrome and many migrated to it as Safari had bugs . Although it has improved a lot over years, sometimes the web browser stops working. If you’re facing this issue, here’re twelve fixes for Safari not working on iPhone and iPad.

Safari Not Working on iPhone and iPad

Following are some of the most common methods that have worked to troubleshoot Safari. We recommend you try every method, except the Reset iPhone option which should be used as a last resort. We have provided detailed steps for each method, but let us start with the basics.

Why Is Safari Not Working On iPhone and iPad

Safari might not work for a lot of reasons, but the most common issue is the app not being able to connect to the internet. This is probably because you are not connected to a good internet connection, or there are a few misconfigurations on your iPhone settings that are preventing Safari from doing so.

Fortunately, there are a few effective methods to fix the issue. As you start reading the next section of this article, you will find a detailed procedure to fix Safari on your device.

How to Fix Safari Not Working on iPhone and iPad

Below are twelve easy methods to fix Safari. Most of these will resolve the issue within a few steps only, and therefore will not consume a lot of time.

We also came across a lot of users across forums suggesting toggling a few features off/on to fix the issue. So, let us take a look at all of these methods in detail. We can start by simply trying to restart the device

1. Restart iPhone or iPad

Simply trying to restart your device will fix most issues, and it can probably fix Safari not working as well. Here’s how you can restart your iPhone or iPad.

Step 1:  First, shut down your device.

  • On iPhone X and above : Press and hold the volume down and the side button.
  • On iPhone SE 2nd or 3rd gen, 7, and 8 series : Press and hold the side button.
  • On iPhone SE 1st gen, 5s, 5c, or 5 : Hold the power button at the top.
  • On iPad : Hold the power button at the top.

Restart iPhone

Step 2:  Now, drag the power slider to turn off the device.

Step 3:  Next, turn on your device by pressing and holding the power button on your iPhone.

If it’s a software issue, restarting the device should fix your Safari not working issue. If it doesn’t, try tweaking a few settings shown in the next few fixes and see if they help.

2. Turn off Safari Suggestions

We’re not entirely sure how this fixes the issue, but a lot of users reported that doing this restored the functionality of their browser. Here’s how you can turn off Safari Search Suggestions on iPhone or iPad.

Step 1: Open the Settings app and open Safari

Open iPhone Settings

Step 2: Toggle off ‘Search Engine Suggestions’.

safari keyup not working

That is how you can disable Search Engine Suggestions. If the issue persists, you need to check if Safari is limited by any Screen Time settings.

3. Edit Your Screen Time Settings

To provide digital well-being controls to the user, Apple has an option to set a limit to the duration of any app being used. If you’ve enabled Screen Time for Safari , it cannot be used once you exhaust the set limit. Here’s how you can remove the limit to ensure Safari works as usual on iPhone.

Step 1: Open the Settings app and select Screen Time.

safari keyup not working

Step 2: You need to select App Limits.

safari keyup not working

Step 3: Safari will show up in this list if there is a limit for it. Tap on it, and select Delete Limit.

safari keyup not working

This ensures that you do not have any limits set on using Safari. You now need to check if there is a network limit set on Safari.

4. Check Cellular Settings for Safari

If you have turned off cellular data access for Safari, and are trying to use Safari on mobile data, it won’t work. Therefore, you need to remove the restrictions. Here’s how you can do it.

Step 1: Open the Settings app and select Cellular.

safari keyup not working

Step 2: Scroll down to find Safari. Turn on the toggle to give Safari access to cellular connectivity.

safari keyup not working

If the issue persists, perhaps it is time you now try and clear all browsing data from Safari.

5. Clear Safari History and Data

If you have been using Safari for a long time, it will accumulate a lot of website data. This can slow down Safari and affect the web browsing performance. Hence, it is a good practice to clear browsing history and cache from Safari every fortnight. Here’s how you can do it.

Step 1: Open the Settings app and select Safari.

safari keyup not working

Step 2: Tap on ‘Clear History and Website Data’ and select ‘Clear History and Data’ to confirm. This will delete your browsing history, stored cache, cookies, and saved passwords.

safari keyup not working

6. Check Network Connectivity

As mentioned earlier, a major reason why Safari does not work on iPhone and iPad is due to a lack of connectivity. Here’s how you can ensure that you are connected to a good network on your device.

Step 1: Open the Settings app and select Wi-Fi.

Step 2: Now, check if the Wi-Fi network you are connected to has full strength, and does not show errors like ‘Not Connected to Internet’ or ‘Weak Security’.

safari keyup not working

If you are operating on mobile data, the connection needs to either be on 4G or 5G running on strong signal strength.

Step 2: Ensure the toggle is on for Cellular Data. Also, ensure that the network is connected to 4G/5G and has a good signal strength.

safari keyup not working

Step 3: If you can’t connect to a 4G or 5G network despite having a plan for the same, tap on ‘Cellular Data Options’.

Step 4: Now, tap on ‘Voice & Data’. Select 4G or 5G as your default network.

safari keyup not working

7. Turn Off Hide IP Address From Trackers

The ‘Hide IP Address From Trackers’ option ensures that your IP address is not provided to any browser trackers. To know more, you can read our article on trackers on Safari . However, this causes a few issues that might cause Safari to not work on iPhone and iPad.

Here’s how you can disable this feature.

Step 2: Tap on ‘Hide IP Address’.

safari keyup not working

Step 3: Select Off, if not already.

safari keyup not working

Another feature on Safari that might cause a few errors are extensions. Here’s you you can disable them to fix Safari not working on iPhone and iPad.

8. Check Safari Extensions

While Safari extensions on iPhone help expand functionality, not all extensions are stable and some might cause issues with your web browsing experience. Here’s how you can turn off an extension.

Note : The extension we are using to show you the steps is just an example. By no means we are stating that this extension is causing issues.

safari keyup not working

Step 2: Now, tap on Extensions.

safari keyup not working

Step 3: Now, select the extension, and toggle it off.

safari keyup not working

This is how you can turn off extensions to ensure they are not the means of any problem. However, sometimes disabled JavaScript can also affect Safari. Let’s understand this in detail in the next section.

9. Enable JavaScript

JavaScript is a crucial element in websites that enables interactive content. If you disable it, you won’t see any images, videos, or other media content on a website. Thus, it can prevent Safari from responding on iPhone. Here’s how you can turn JavaScript on.

Step 2: Scroll down and tap on Advanced.

safari keyup not working

Step 3: Ensure to turn on the toggle for JavaScript.

safari keyup not working

That is how you enable JavaScript and ensure all kinds of websites work fine on Safari. If this does not work too, you need to check if your device is connected to a VPN network and if this prevents Safari to operate normally.

10. Disable VPN

VPN is a private network that hides your IP address while browsing the web. However, if you don’t connect to a VPN using a reliable service, you will face low speeds while browsing on Safari. Therefore, you can turn off the VPN connection.

Step 1: Open the Settings app and select General.

safari keyup not working

Step 2: Tap on ‘VPN & Device Management’ and ensure that the VPN status remains ‘Not Connected’.

safari keyup not working

If none of the above methods work, you can try some generic methods that help resolve most issues on iPhone and iPad, you can check if there is any software update for your iPhone.

11. Update Your iPhone and iPad

Apple ensures to fix issues faced by a lot of users through a software update. Therefore, it is best to remain on the latest version of iOS. Here’s how you can do the same.

Step 2: Tap on Software Update and select Download and Install. This will download and install the latest iOS update for your iPhone and iPad.

safari keyup not working

If this does not work either, you can probably try and reset your iPhone or iPad as a last resort.

12. Reset All Settings

Resetting your iPhone has a good probability of fixing any issue, and it goes the same for Safari not working as well. Here’s how you can Reset your iPhone.

Step 2: Tap on Transfer or Reset.

Step 3: Select Reset.

Step 4: Now, you can select Reset Network Settings to restore all original settings related to the network, i.e Wi-Fi settings, cellular Settings, saved passwords, etc.

If that does not work, you can select Reset All Settings. However, this will restore all your iPhone settings to default. This will not erase any of your data.

safari keyup not working

Step 5: If this does not work too, you can try to completely erase your iPhone and start afresh. You can tap on the ‘Erase All Content and Settings’ option on the reset page.

Now, follow the on-screen instructions to erase and reset your iPhone. However, since it wipes your phone, we suggest you take a full backup of your iPhone and iPad .

safari keyup not working

This, as mentioned earlier, should only be tried as a last resort as you’ll have to set up your iPhone or iPad as a new device.

Get Safari Working Again With these methods

That is all you need to know about trying to fix Safari not working on iPhone or iPad. We hope you found these methods helpful. Realistically speaking, it will most probably be an issue with your network connectivity, or from the website’s end. We hope your Safari is up and running soon.

Was this helpful?

Last updated on 28 March, 2023

The above article may contain affiliate links which help support Guiding Tech. However, it does not affect our editorial integrity. The content remains unbiased and authentic.

my safari icon is gone in the settings where it normally is under the facetime icon but mine is gone

Excellent article! Thank you very much!!

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Top_N_Ways_to_Fix_Gmail_Not_Working_on_Safari

The article above may contain affiliate links which help support Guiding Tech. The content remains unbiased and authentic and will never affect our editorial integrity.

DID YOU KNOW

safari keyup not working

Supreeth Koundinya

Supreeth is passionate about technology and dedicates himself to helping people figure it out. An engineer by education, his understanding of the inner workings of each device is what ensures he provides top-quality assistance, tips, and recommendations. When away from the desk, you will find him traveling, playing FIFA, or hunting for a good movie.

More in iOS

delayed WhatsApp notifications

Top 10 Ways to Fix Delayed WhatsApp Notifications on iPhone

How to Make Apple Music Louder on iPhone

6 Ways to Make Apple Music Louder on iPhone

Join the newsletter.

Get Guiding Tech articles delivered to your inbox.

  • Skip to main content
  • Skip to search
  • Skip to select language
  • Sign up for free
  • English (US)

Element: keyup event

The keyup event is fired when a key is released.

The keydown and keyup events provide a code indicating which key is pressed, while keypress indicates which character was entered. For example, a lowercase "a" will be reported as 65 by keydown and keyup , but as 97 by keypress . An uppercase "A" is reported as 65 by all events.

Keyboard events are only generated by <input> , <textarea> , <summary> and anything with the contentEditable or tabindex attribute.

Since Firefox 65, the keyup and keydown events are now fired during IME composition, to improve cross-browser compatibility for CJKT users ( Firefox bug 354358 . To ignore all keyup events that are part of composition, do something like this (229 is a special value set for a keyCode relating to an event that has been processed by an input-method editor ( IME )):

Use the event name in methods like addEventListener() , or set an event handler property.

A KeyboardEvent . Inherits from UIEvent and Event .

Event properties

This interface also inherits properties of its parents, UIEvent and Event .

Returns a boolean value that is true if the Alt ( Option or ⌥ on macOS) key was active when the key event was generated.

Returns a string with the code value of the physical key represented by the event.

Warning: This ignores the user's keyboard layout, so that if the user presses the key at the "Y" position in a QWERTY keyboard layout (near the middle of the row above the home row), this will always return "KeyY", even if the user has a QWERTZ keyboard (which would mean the user expects a "Z" and all the other properties would indicate a "Z") or a Dvorak keyboard layout (where the user would expect an "F"). If you want to display the correct keystrokes to the user, you can use Keyboard.getLayoutMap() .

Returns a boolean value that is true if the Ctrl key was active when the key event was generated.

Returns a boolean value that is true if the event is fired between after compositionstart and before compositionend .

Returns a string representing the key value of the key represented by the event.

Returns a number representing the location of the key on the keyboard or other input device. A list of the constants identifying the locations is shown in Keyboard locations .

Returns a boolean value that is true if the Meta key (on Mac keyboards, the ⌘ Command key; on Windows keyboards, the Windows key ( ⊞ )) was active when the key event was generated.

Returns a boolean value that is true if the key is being held down such that it is automatically repeating.

Returns a boolean value that is true if the Shift key was active when the key event was generated.

addEventListener keyup example

This example logs the KeyboardEvent.code value whenever you release a key inside the <input> element.

onkeyup equivalent

Specifications, browser compatibility.

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

If Safari doesn't open a page or work as expected on your Mac

If Safari doesn't load a webpage, stops responding, quits unexpectedly, or otherwise doesn't work as expected, these solutions might help.

These solutions are for issues that can affect Safari on Mac, including issues such as these:

A webpage is blank, doesn't load all of its content, or otherwise doesn't work as expected.

You can't sign in to a webpage, despite using the correct sign-in information.

A webpage asks you to remove or reset cookies.

Safari slows down, stops responding, or quits unexpectedly.

Reload the page

From the menu bar in Safari, choose View > Reload Page. Or press Command-R.

If Safari doesn't reload the page, quit Safari, then try again. If Safari doesn't quit, you can press Option-Command-Esc to force Safari to quit .

If Safari automatically reopens unwanted pages, quit Safari, then press and hold the Shift key while opening Safari. Learn how to control which windows Safari automatically reopens .

Install software updates and restart

Update macOS , which can include updates for Safari. If your Mac didn't restart automatically, choose Apple menu  > Restart. Some important background updates take effect only after restarting.

Check Safari extensions

If you installed any Safari extensions, turn extensions off. From the menu bar in Safari, choose Safari > Settings (or Preferences). Click Extensions, then deselect each extension to turn it off. Learn more about Safari extensions .

If you find that an extension is causing the issue, make sure that the extension is up to date.

Test with a private window

A website can store cookies, caches, and other data on your Mac, and issues with that data can affect your use of the website. To prevent the website from using that data, view it in a private window: From the menu bar in Safari, choose File > New Private Window, or press Shift-Command-N.

If that works, use the following steps to remove the website's data, including its caches and cookies. The website can then create new data as needed. If it's a website that you sign in to, make sure that you know your sign-in information before continuing.

Choose Safari > Settings (or Preferences), then click Privacy.

Click Manage Website Data.

Select the affected website from the list shown.

Click Remove.

Click Done.

Open the website again in a non-private browser window.

Check Safari settings

The webpage might not be compatible with one or more browser settings, which you can turn on or off as needed. From the menu bar in Safari, choose Safari > Settings (or Preferences). Then click Websites, Privacy, or Security to access these settings:

Privacy settings . These settings apply to all websites. For example, a website might require that you allow cross-site tracking, show your IP address, or allow cookies.

Security settings . These settings apply to all websites. For example, a website might require that you enable JavaScript.

Websites settings . These settings can be configured for specific websites. For example, a website might require that you allow pop-up windows, allow downloads, allow access to your camera or microphone, or turn off content blockers.

Check iCloud Private Relay

If you subscribe to iCloud+ and are using its Private Relay feature, try reloading the page without Private Relay: From the menu bar in Safari, choose View > Reload and Show IP Address. This menu item appears only when Private Relay is turned on for your network. Learn more about iCloud Private Relay .

Check VPN or other security software

If you installed VPN or other software that monitors or interacts with your network connections, that software could affect your use of the website or the internet. Learn about network issues related to VPN and other software .

Check network settings

Certain network settings, such as custom proxy settings or custom DNS settings , can affect access to content on the internet. Even if you haven't changed these or other network settings yourself, you might have installed software that changed them for you.

To find out whether the issue is with the network settings on your Mac, try viewing the page from a different web browser or different device on the same network. Or reset your network settings by setting up a new network location on your Mac.

If the issue affects other devices and web browsers on the same network, the issue is probably with the website, and you should contact the website developer for help.

If the issue continues to affect only a particular webpage, contact the website developer for help.

Learn how to block pop-up ads and windows in Safari .

Learn what to do if your iCloud or Safari bookmarks aren't syncing .

safari keyup not working

Related topics

safari keyup not working

Explore Apple Support Community

Find what’s been asked and answered by Apple customers.

Sign up for our daily newsletter

  • Privacy Policy
  • Advertise with Us

Safari Not Working on Your iPhone? Here’s How to Fix It

Ojash Yadav

Although iPhones and iPads support other apps to reach the Web, Safari remains the most favored and frequently used browser for iOS users. Troubleshooting on Safari can be frustrating, especially if its issues prevent you from searching for a solution online. Here are a few common reasons why Safari may not be working on your iPhone and how to fix the problems.

Turn on Mobile Data for the Safari App

Disable experimental features, change your network settings.

Also read: How to Make Mobile Safari Save Your Passwords on iOS

Test Your Internet Connection

To begin with, ensure that the problem is with Safari and not with your internet connection. For this, open, say, a non-Apple app like Facebook or Chrome, and see whether the website or the feed loads. If it does, then Safari is at fault. Otherwise, your internet connection is at fault. If it’s the former, move on to the next step.

If you’ve been exploring your iPhone’s data-saving features, which let you specify which apps have access to your phone’s mobile data, then there’s a chance that you turned off mobile data for the Safari app. That means Safari will work when you’re connected to Wi-Fi but not to mobile data. (Try running Safari over Wi-Fi to test this.)

If that’s the case, then to turn mobile data back on for Safari, go to “Settings -> Mobile Data,” and then in the “Mobile Data” list, make sure the slider next to Safari is in the green “On” position.

Turn On Cellular Data For Safari App

Also read: 20 of the Best Siri Shortcuts for iOS Power Users

You may not know about this, but Safari for the iPhone has a whole load of experimental features that you can disable and enable as you please.

The problem with these, as the name suggests, is that they are indeed experimental and subsequently don’t all work properly. Disabling them one by one can fix Safari if it’s not working and help you discover which exact feature was causing the problem,

On your iPhone, go to “Settings -> Safari -> Advanced -> Experimental Features.”

Turn On Cellular Experimental Features For Safari App

If you have more than one feature enabled here, disable just one, then check to see if Safari works normally again. If it doesn’t, re-enable that feature (if you want it) and disable the next one. Keep repeating this procedure until Safari starts working again.

Turn Off Experimental Features For Safari

Also read: Everything You Need to Know About Using “Shared with You” in iOS 15

Try resetting your Wi-Fi connection and reconnecting to the network.

  • Go to “Settings -> Wi-Fi” and turn it off, then turn it back on after a few seconds.

Turn Off And Turn On Wifi

  • If you’re using mobile data, go to “Settings -> Mobile Data” and turn “Mobile Data” off and back on after a few seconds.

Turn Off And Turn On Mobile Data

  • If neither option works, go to “Settings -> Wi-Fi,” connect to a different Wi-Fi network, and try loading the web page again.

Change Wifi Network

If the problem persists, try restoring your network settings to their original configuration.

  • Go to “Settings -> General -> Transfer or Reset iPhone -> Reset” and choose “Reset Network Settings.”

Restoring Your Network Settings

Also read: How to Fix Contact Names Not Showing, Appearing as Numbers in iOS

Common Problems With Safari And How To Solve Them

By following the fixes we’ve mentioned above, you should be able to revive Safari and make it work normally again. However, there are some specific issues that commonly come up with Safari. Here’s how to solve them.

Problem: Safari Crashed and Won’t Open

If you’ve ever panicked after Safari closed unexpectedly and couldn’t get the app to start, you probably encountered a bug that affects Safari’s search engine suggestions. This issue can cause the app to crash, freeze, or fail to start altogether. Although the bug usually plagues devices running iOS 10, it can affect just about any iPhone or iPad.

How to Fix It: Disable Search Engine Suggestions

Go to “Settings” and choose “Safari” in your list of apps. Here, find “Search Engine Suggestions” and turn it off.

Turn Off Seqarch Engine Suggestions

This feature offers suggestions for what you can search for as you type into Safari’s search bar. Disabling it gets rid of the problem for many users.

Problem: Safari Is Gray (and Won’t Open)

Sometimes when you update your iPhone’s iOS to a newer version, you may encounter a bug that turns some apps gray and prevent them from opening.This bug causes Safari to stop working and turns its icon gray when you switch to another app while Safari is running in the background.

How to Fix It: Update Your Software

To solve this problem, update your iPhone to the latest version of iOS. Apple includes important bug fixes in each software update, so it’s important to keep your iPhone or iPad up to date. iOS 11.1 fixed this bug for most users, so be sure to update to 11.1 or greater if you’re running an older version of iOS.

Go to “Settings -> General,” choose “Software Update,” and install the latest update.

Update Ios Software

Also read: How to Update to iOS 17 Smoothly

Problem: Safari Is Slow

As powerful as your iPhone can be, it can get bogged down with all the extraneous information that it processes. If you notice that Safari takes longer to load pages or graphics, it may be time to do some housekeeping. Try clearing your browser history, website data, and cache to make Safari run more smoothly.

How to Fix It: Clear Your Data

To delete your cookies, cache, and browsing history, go to “Settings -> Safari,” choose “Clear History and Data,” and confirm that you want to go ahead. Safari will remember your AutoFill information if you choose this option.

Clear Website Data Safari

To keep your browsing history but clear your cache and cookies, first go to “Settings -> Safari -> Advanced.”

Safari Advance Settings Menu

There, choose “Website Data -> Remove All Website Data” and tap “Remove Now.” Note that Safari will not remember your AutoFill information if you choose this option.

Remove Website Data Safari 2

To remove only a portion of your browsing history, cache, and cookies, start by opening Safari and tapping the Bookmark icon. Here, open your history and tap “Clear.” Now Safari will give you the option to clear your history, cookies, and browsing data from the past hour, the past day, the past 48 hours, or from your entire history. Pick the relevant option.

Delete History Safari

Problem: Safari Still Isn’t Working

Although it sounds cliche, turning your phone off and back on again can be the solution to any number of Safari-related issues.

How to Fix It: Restart Safari or Reboot Your Phone

If none of the previous fixes help solve your problem, try restarting the app or rebooting your phone.

Image7

  • Swipe up from the bottom of the screen and press on the screen when your finger is near the center to open the multitasking view, and then swipe up on Safari to close it. This will reset Safari.
  • To shut down your phone, press and hold the sleep/wake button until a slider appears. Slide to the right to power off your phone. For iPhone X and above, press and hold the side button and one of the volume buttons until the slider appears. Then slide it to the right to power off your phone.

Also read: How to Block Websites on Chrome, Firefox, Edge, Safari, Android, and iOS

Frequently Asked Questions

How to fix "safari can't find server" on iphone.

The most probable and common reason behind the “Safari can’t find server” error is not with Safari but with your internet connection. Here are a few ways to fix it.

  • Reset your wireless router.
  • Turn mobile data off and turn it back on again.
  • Clear Safari cache and data.
  • Restart your iPhone.

How to reset Safari on iPhone?

To reset Safari on your iPhone, open the Settings app and scroll to the Safari settings. There, tap on “Clear History and Website Data” and the bottom of the page and follow up along with the pop-up on your screen to confirm the action. Once it’s complete, all your data and cookies will be wiped clean, and Safari will be as good as new.

Can you reinstall Safari on your iPhone?

Yes, just like any other app, you can uninstall Safari from your iPhone by holding down the Safari icon on the home screen and tapping “Remove app.” Then, visit the App Store, search for Safari, and reinstall it from there. Can’t find the Safari app to delete it? Here’s how to delete hidden apps .

Image credit: Flickr

Our latest tutorials delivered straight to your inbox

Ojash Yadav

Ojash has been writing about tech back since Symbian-based Nokia was the closest thing to a smartphone. He spends most of his time writing, researching, or ranting about Bitcoin. Ojash also contributes to other popular sites like MakeUseOf, SlashGear, and MacBookJournal.

10 Ways to Fix Safari Not Working on an iPhone

Follow these simple troubleshooting steps to fix Safari if it isn’t working properly on your iPhone.

Safari is the native browser for iPhones, iPads, and MacBooks. It comes pre-installed on almost every Apple device, and it's designed to be fast and efficient for them. However, there are times when Safari doesn't work.

When this happens, it usually means there's a setting or software issue. There are even cases where you might not be able to access the internet at all on your iPhone or iPad. Luckily, there are a variety of things you can try to get Safari working again.

1. Restart Your Device

You hear it all the time—turn your device off and on again. While this may sound too simple to work, restarting your iPhone or iPad has been known to clear your usable memory, which can speed up Safari.

If Safari is frozen or just a blank white screen, restarting your iPhone or iPad can also fix these problems. Before you try anything else, just make sure you cover the basics.

If you're new to Safari or Apple devices, you might want to check out our beginner's guide to Safari for iPhone and iPad users .

2. Turn Off Safari Suggestions

Turning off Safari Suggestions is one of the simplest and most common fixes for Safari not loading or crashing on an Apple device. While we aren't sure why this works, many users have reported that turning this off fixes the problem.

To turn off suggestions, head to Settings > Safari > Safari Suggestions and turn this off. You can also turn off Search Engine Suggestions while you're there too, as some users reported this also fixes the issue.

Some users have also said that blocking Safari popups on your iPhone can improve the memory usage of Safari. So, you may also want to give this a try.

If this fixes your issue, then you're all set. If not, try the following steps.

3. Turn On Cellular Data for Safari

If you're frequently connected to Wi-Fi, you may have cellular data off for Safari to save internet data. While helpful, if your Wi-Fi isn't functioning right, connecting to cellular data could fix your issue.

To do this, head to Settings > Cellular > Safari and turn this on. If it was off, this was most likely the cause of your issue. Alternatively, you can turn off Wi-Fi if you're connected and just connect with cellular data. If you can connect this way, that means there's a network issue with your Wi-Fi network.

4. Edit Your Screen Time Settings

If you've ever changed your Screen Time settings or blocked certain websites through Screen Time, try turning these settings off. To block websites, you need to enable Content Restrictions which can inadvertently block websites you still want to use. If you can't load a link from an email or text message, this could also be a sign that content restrictions are on.

To fix this issue, head to Settings > Screen Time > Content & Privacy Restrictions and turn this option off. If it was on, then this was most likely your issue. If it was off already, proceed to the next fix.

5. Clear All Safari's Data

If you frequently use Safari, you might have a lot of data stored within the app, making it fail to load correctly. This is especially true if you're using an iPhone or iPad with a lower storage capacity. If you get low storage notifications, this fix could resolve your issue.

To clear Safari's data, head to Settings > Safari > Clear History and Website Data . This will erase all extra data in the Safari app. Some users report this works, but you'll need to do it often if you can't eliminate storage space elsewhere on your iPhone.

6. Update iOS to the Latest Version

Some users have reported that updating iOS resolves issues with Safari. Whether Safari isn't loading, is crashing, or just isn't connecting to websites, try updating iOS on your iPhone .

Apple does a great job of fixing widespread issues with iOS updates. So, if there is an issue that Apple is aware of, it could get fixed by a subsequent update.

7. Reset Your Network Settings

If you've had issues with your network before, like not getting service or pages timing out, resetting your Network Settings could help.

To reset the Network Settings on your iPhone or iPad, head to Settings > General > Transfer or Reset iPhone (iPad) > Reset > Reset Network Settings . This will reset only your Network Settings and won't erase any other data on your iPhone.

After you finish this, try opening Safari to see if it's working again. If not, proceed to the next fix.

8. Reset to Factory Default Settings

If all else fails, you can try resetting your iPhone to the default settings. This will erase all the data on your iPhone, and you'll have to set it up from scratch. However, this is also a very effective way to resolve all kinds of software problems. To do this, head to Settings > General > Transfer or Reset iPhone (iPad) > Erase All Content and Settings .

After resetting to the default settings, test out the Safari app before you install your usual apps. If Safari is working then but stops working when a certain app is installed, that means the app installed is interfering with Safari.

If Safari isn't working when you have a fresh install, make sure you didn't restore a backup of your iPhone or iPad . If you restored a backup, there could be something interfering with Safari that transferred over. If you reset your device without a backup and Safari still doesn't work, you can try one of the two last troubleshooting steps.

9. Turn On JavaScript

JavaScript is on by default on most iOS devices. However, if you're having issues with Safari, it's likely that JavaScript is off. Sometimes, one might turn JavsScript off as some websites might not support it.

If you've turned JavaScript off or want to check if it's off and turn it back on, head to Settings > Safari > Advanced on your iOS or iPadOS device.

10. Use an Alternative Browser

If the above fixes didn't work, then unfortunately, there might be an iOS bug with Safari, and you'll need to wait for the next update and hope it's patched. Until then, you can try using an alternative browser to access the internet on your device. There are many great browsers available in the App Store that can cater to your needs.

Be sure to check back for iOS updates and see if Apple has addressed the bug. You can also start a new discussion in the Apple Discussions Community to see if anyone else is experiencing the same issue.

Safari Not Working on Your iPhone or iPad? It's Most Likely a Software Issue

Cracked screens and broken buttons are easy to diagnose as we can instantly see what's wrong. But when Safari or other apps on your iPhone stop working, that usually means a software issue is at play.

You can usually fix these issues by updating iOS, changing your settings, or resetting your device. However, if the issue still isn't fixed after trying everything above, you might need to post in the Apple forum about your issue for more help.

'keyup/keydown' not working as events. Has happened before too

I am not able to make the ‘keyup’ etc. events to work, on a template basis. It only works by attaching a callback to the ‘document’ in ‘Template.onCreated()’; as described here: https://stackoverflow.com/questions/27972873/meteor-keydown-keyup-events-outside-input

This has also happened before and also fixed before. Here: https://github.com/meteor/meteor/issues/2024

Or is the bug still there. The Docs talk about using ‘keyup’/‘keydown’ easily for capturing arrow keys.

What is the latest update on this? & how should we deal with this.

Do you have a code sample?

The code was too obvious so I didn’t add it. Here it is:

Events/Helpers:

I have tried all possible combinations by including/excluding the template id ( #test ). Using old/new syntax for declaring event handlers etc. Adding body beside click/keyup: ‘click body’/‘keyup body’.

It doesn’t work. The console remains mum.

The problem has happened before. Others have reported, as there in the links.

A solution has also been suggested as there in the second link. It works for the time being.

Pls. help everyone.

I forgot to add, that, the events works with ‘click’ on the ‘button’, & ‘keyup’ in ‘input’ etc. This has also been told 2 yrs. back in the above links.

Okay, so you have the wrong template name in your handler, you are using “Template.hello.events”, when it should be “Template.eventTest.events”.

“click #test ” this has the selector #test , which is not an element, (but a template…?), and certainly not a button.

“keyup” is missing a selector.

There are no buttons here at all in fact.

Ooops! Terribly sorry!

It’s surely not as obvious as it looks. I am surely making a mistake! One of the mistakes I have caught. (below).

I actually had to make a new project to test this, coz my old code had by now expanded a lot.

I made an error!

Everyone pls. help.

Here is the new VALID code:

And handlers:

I am very happy to report that ‘click’ is working on ‘div’ or ‘p’, …

… & even without an element as in the code above. But as it should, it’s only working inside the template. Which is great!

‘keyup’ is not working any which way:

WHAT am I doing wrong? Is this the correct way to use ‘keyup’?

And many many thanks for ur help.

Summer Greetings from India.

For the “keyup” event to trigger, the event target must be an input element that can be typed in. It will not work with ‘p’ and ‘div’ since you cannot type in there. Try with an input element.

How do we capture the ‘keyup’/‘keydown’ events outside of element. Say on the page.

How do we capture arrow keys?? Is there any way apart from the links at the top?

Thought I’d document a simple fix for this:

Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others!  Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

suitsusir

Arrow keys not working in Safari

The arrow keys on my external keyboard (Macally) stopped scrolling properly in Safari a few days ago. Press the upper arrow and I jump to the top of the page. Press the lower arrow and nothing happens. I can still scroll effectively with a mouse. And the keyboard itself is fine. I connected it to another MBP with the same updated version of Monterey and it works. It also works in MSWord, TextEdit, Crome and Firefox. I have not installed any new software recently.

I tried rebooting in safe mode but the Safari problem is still there. I also reinstalled the system software but to no avail.

I also noticed that if I enter text manually on sites in Safari, it will accept the first word but no spaces after that. It will only accept a sentence or paragraph of text created in another programme and then pasted into Safari.

What is this all about? Any help would be much appreciated.

MacBook Pro Apple Silicon

Posted on Jun 25, 2022 3:57 PM

Similar questions

  • Slow loading and keyboard lag in MacBook Air (Retina, 13-inch, 2018) Using Mac OS Monterey 12.4. The Safari tabs are slow to load and move slowly sometimes freezing. Refresh sometimes helps, sometimes not The keyboarding is quixotic, both in emails and in word documents. Sometimes there is a considerable lag between the typing and when the characters appear. The cursor moves around and suddenly I am inputting text far from the place I intended. I have an EtreCheck report but do not know how to paste it without exceedint the 5000 character limit. Where is the "additional text feature"? 742 4
  • Spacebar doesn't work sometimes in Safari Quite often, while I use Safari to enter texts, the spacebar doesn't work (no response when the spacebar is pressed, but a blue rectangle shows up randomly). But it works with other apps like Notes, or Text. For not any particular reason, it works again after a while. Need some help to identify what is wrong in my computer or operation. Current system: Mac mini M1 2020, Monterey 12.3.1 Apple bluetooth keyboard (first generation) and mouse (2nd generation) Thanks. 862 2
  • cannot type in Launchpad search bar | esc key won't escape after Ventura security update The following problems started happening after installing the latest Ventura security update 13.4.1 (c) on my 2020 M1 Mac Air. When I click on the Launchpad icon in the dock, Launchpad opens. When I type the name of an app in the Search window, no characters appear. I exit Launchpad. However, what I typed in the Launchpad Search window appears in the a) body body of text editors (Pages 13.1 or TextEdit 1.18) or b) in the address bar in whichever browser I'm using (Firefox 115.0.2, Safari 16.5.2). If I'm in a text editor when I try to search for an app, the text I searched for appears in the body of the text. If I'm using a browser when I try to search for an app, the text I searched for appears in that browser's address bar. Just now, while in the "provide more details" window, whatever is typed in the Launchpad Search window appears here ___ 106 3

Loading page content

Page content loaded

safari keyup not working

Jun 26, 2022 11:53 AM in response to suitsusir

Hello suitsusir,

To help isolate the cause of this issue, create a new user account and test to see if the keyboard works properly in that new user account. This article shows you how:

Set up users, guests and groups on Mac - Apple Support

On your Mac, choose Apple menu   > System Preferences, then click Users & Groups 
If the lock at the bottom left is locked , click it to  unlock the preference pane .
2. Click the Add button  below the list of users
3. Click the New Account pop-up menu, then choose a type of user.
4. Enter a full name for the new user. An account name is generated automatically. To use a different account name, enter it now — you can’t change it later
5. Enter a password for the user, then enter it again to verify. Enter a password hint to help the user remember their password.
6. Click Create User.

Best Regards.

nick_h2

Jun 26, 2022 3:48 PM in response to suitsusir

Since this hasn't been resolved with safe mode or the other steps we've discussed here you'll need to Contact Apple Support to go over more troubleshooting.

Use the link above to get in touch.

We hope this helps.

ShannonM1

Jun 26, 2022 10:15 AM in response to suitsusir

We understand that your keyboard isn't working properly on your one Mac, but looks to work with another. Are they both Silicon-based Macs or is one Intel? Also, have you confirmed there's no third-party firmware update for the keyboard?

Jun 26, 2022 11:35 AM in response to ShannonM1

Thanks for your message. The keyboard is not working properly on my Silicon Mac but works fine on the Intel Mac. I have had a look for firmware but have not found anything. Btw, it's a wired MKEYE.

Jun 26, 2022 3:21 PM in response to Community User

I created a new account, logged in and the arrow keys all work fine in Safari. Logged out and back to my regular account and still have the same problems I described.

COMMENTS

  1. Keyup event not fired in safari browser only?

    The rest of the browsers it is working fine. Whenever I type a number, I'm getting the keyup event in all mobile and computer browsers except Safari, the problem is keyup/keydown event is not firing in Safari. I tried with all possible bind &trigger events. I am looking to change the value based on the user input rather than increasing the ...

  2. JavaScript keyup eventlistener does not work on iPhone

    1. I have several events that use keyup, but they do not fire on iOS in safari. Is there another event listener that can accomplish similar actions? Example of keyup I use to detect when someone is typing in a searchbox. document.getElementById('user_search_select').addEventListener("keyup", e=>{livebox(usersearch_counter=0)}); javascript. ios.

  3. Why doesn't the keyUp event work i…

    override func keyUp(theEvent: NSEvent) {. self.nextResponder.keyUp(theEvent); This code will manually pass the events up along the responder chain (see lines 10 and 14). Add it to your app, click it in the window to highlight it, then try pressing keys. It should pass both key-down and key-up events to the superview.

  4. My keyboard doesn't come up on safari

    keyboard not shows up Hey, I have problem with keyboard. It isn't show up when I try to type something in eg. Safari (google.pl - search). This problem is also in other applications. Sometimes is ok, and sometime not. I tried to turn off all option in keyboard settings, change keyboard to other company. Problem is still apply. Have You any idea?

  5. Safari Not Working? How to Troubleshoot Your Problems

    Open Safari: Start by launching the Safari browser on your Mac.; Access Preferences: In the menu bar at the top of the screen, click "Safari" and then select "Settings" from the dropdown menu.; Go to the Advanced Tab: In the Preferences window, navigate to the "Advanced" tab.; Enable the Develop Menu: At the bottom of the Advanced tab, check the box next to "Show Develop menu in ...

  6. If Safari isn't loading websites or quits on your iPhone, iPad, or iPod

    Connect to a different network. Try to load a website, like www.apple.com, using cellular data. If you don't have cellular data, connect to a different Wi-Fi network, then load the website. If you're using a VPN (Virtual Private Network), check your VPN settings. If you have a VPN turned on, some apps or websites might block content from loading.

  7. Top 12 Ways to Fix Safari Not Working on iPhone and iPad

    Here's how you can turn off Safari Search Suggestions on iPhone or iPad. Step 1: Open the Settings app and open Safari. Step 2: Toggle off 'Search Engine Suggestions'. That is how you can ...

  8. Element: keyup event

    The keyup event is fired when a key is released.. The keydown and keyup events provide a code indicating which key is pressed, while keypress indicates which character was entered. For example, a lowercase "a" will be reported as 65 by keydown and keyup, but as 97 by keypress.An uppercase "A" is reported as 65 by all events. Keyboard events are only generated by <input>, <textarea>, <summary ...

  9. Keyboard stops working in Safari

    Good morning vermp! I see that you're having some trouble with the keyboard working in Safari. I'll be happy to help out. You may want to consider clearing the history and cache in Safari to see if this helps with the issue: Clear your browsing history in Safari on Mac - Apple Support Also try restarting the MacBook. If you're still having trouble, try seeing if this same problem occurs in ...

  10. The up and down arrows not working correctly in Safari

    M1 Mac Mini running Monterey 12.6.5 - Safari 16.4.1 Problem is with trying to use the up and down arrows on a wired keyboard in Safari. The expected behavior is that every time I press the down (or up) arrow, the web page would move down (or up) 1 line.

  11. If Safari won't open a page or work as expected on your Mac

    Reload the page. From the menu bar in Safari, choose View > Reload Page. Or press Command-R. If Safari won't reload the page, close Safari, then try again. If Safari won't close, you can press Option-Command-Esc to force Safari to close. If Safari reopens unwanted pages automatically, close Safari, then press and hold the Shift key while ...

  12. Arrow key scrolling broken in Safari 16.5…

    Arrow key scrolling broken in Safari 16.5 (Ventura) As of recently, hitting arrow keys as described on this page: Keyboard shortcuts and gestures in Safari on Mac - Apple Support (UK) does not work as described on that page. That page says. as of now: > Scroll up, down, left or right: Press the arrow keys. However, pressing arrow keys does ...

  13. If Safari doesn't open a page or work as expected on your Mac

    Reload the page. From the menu bar in Safari, choose View > Reload Page. Or press Command-R. If Safari doesn't reload the page, quit Safari, then try again. If Safari doesn't quit, you can press Option-Command-Esc to force Safari to quit. If Safari automatically reopens unwanted pages, quit Safari, then press and hold the Shift key while ...

  14. Safari Not Working on Your iPhone? Here's How to Fix It

    This will reset Safari. To shut down your phone, press and hold the sleep/wake button until a slider appears. Slide to the right to power off your phone. For iPhone X and above, press and hold the side button and one of the volume buttons until the slider appears. Then slide it to the right to power off your phone.

  15. 10 Ways to Fix Safari Not Working on an iPhone

    Luckily, there are a variety of things you can try to get Safari working again. 1. Restart Your Device. You hear it all the time—turn your device off and on again. While this may sound too simple to work, restarting your iPhone or iPad has been known to clear your usable memory, which can speed up Safari.

  16. My arrow keys aren't working in safari : r/osx

    Turns out to be 1password 8 - when auto-filling a password 1password must "hijack" the cursor to enter in the username / password details. After it auto-submits, 1password must forget to return the cursor to the user - and consequently stops the up/down arrow keys from working. Not sure if this will help anyone - but I went through a thorough ...

  17. 'keyup/keydown' not working as events. Has happened before too

    I am very happy to report that 'click' is working on 'div' or 'p', … 'click div' or, 'click p' … & even without an element as in the code above. But as it should, it's only working inside the template. Which is great! 'keyup' is not working any which way: 'keyup div' 'keyup p' or plain: 'keyup' WHAT am I doing wrong?

  18. html

    keyup/keydown seem to only work on elements that are present at document.ready.. If you are triggering your event from elements that were altered or injected post pageload, these events will not fire. Finding or creating a parent of the element to be watched that's present on load then setting the event to trigger from that parent element can bypass this.

  19. Arrow keys not working in Safari

    This article shows you how: Set up users, guests and groups on Mac - Apple Support. Add a user. On your Mac, choose Apple menu > System Preferences, then click Users & Groups. If the lock at the bottom left is locked , click it to unlock the preference pane. 2. Click the Add button below the list of users. 3.